-
Notifications
You must be signed in to change notification settings - Fork 0
/
grasshopper
36 lines (32 loc) · 1007 Bytes
/
grasshopper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
if [[ $1 = "-a" ]]; then
echo "Running cron..."
ruby /usr/share/grasshopper/graSSHopper-cron.rb
elif [[ $1 = "-c" ]]; then
vi /usr/share/grasshopper/commands.cfg
elif [[ $1 = "-s" ]]; then
vi /usr/share/grasshopper/servers.cfg
elif [[ $1 = "-v" ]]; then
echo "v.1.0-1"
elif [[ $1 = "-t" ]]; then
ruby /usr/share/grasshopper/graSSHopper-scp.rb
elif [[ $1 = "-h" ]]; then
cat << EOF
GRASSHOPPER
NAME
grasshopper - run commands against multiple servers.
SYNOPSIS
grasshopper [OPTION]
DESCRIPTION
Run commands against multiple serves with user input or as a crontab job.
USAGE:
- h: Display this menu
- a: automatic, runs commands in commands.cfg against servers in servers.cfg
- c: Edit commands.cfg
- s: Edit servers.cfg
- t: SCP version of the tool
EOF
else
echo "Running in normal mode..."
ruby /usr/share/grasshopper/graSSHopper.rb
fi