david/sshbackup
david
/
sshbackup
Archived
1
0
Fork 0

working..

This commit is contained in:
david 2012-12-18 21:11:07 +01:00
parent 74c36dca7e
commit 522e58be89
1 changed files with 44 additions and 0 deletions

44
deploy.sh Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
# deploy remote config
# sshbackup
config()
{
deploy()
{
remoteadmin=$1
remotemachine=$2
backupuser=$3
echo "deployment started: $remoteadmin@$remotemachine - $backupuser"
}
if [ $USER == "root" ]; then
echo "warning: there is no need to run this script with root privileges."
echo "warning: however, it is possible if you wish to do so anyway."
echo "do you want to continue as root? (y/n)"
read answer
if [ $answer == "y" ] || [ $answer == "Y" ]; then
config
deploy $remoteadmin $remotemachine $backupuser
else
exit 1
fi
fi
if [ -z $1 ]; then
echo "error: no remote ip or hostname given."
echo "please state remote machine:"
read remotemachine
else
remotemachine=$1
fi
echo "remoteadmin: $remoteadmin"
echo "backupuser: $backupuser"
echo "remotemachine: $remotemachine"