applied some corrections

This commit is contained in:
primardj 2024-01-22 00:44:36 +00:00
parent abf7786020
commit 66d877d267
2 changed files with 16 additions and 16 deletions

View file

@ -12,11 +12,11 @@
# and % will delete the parameter at the end.
USER="root"
PORT=10022
VERSION="1.0"
User="root"
Port=10022
Version="1.0.1"
HELP_MESSAGE="
Help_message="
ssh-local [OPTION] [OPTION=VALUE]
script which permit to launch ssh to connect to the vm on localhost without letting any traces on this computer.
@ -34,10 +34,10 @@ for (( arg=1; arg<$#; arg++)); do
value="$((arg+1))"
if [ "${!arg}" == "-u" ]
then
USER=${!value}
User=${!value}
elif [ "${!arg}" == "-p" ]
then
PORT=${!value}
Port=${!value}
fi
done
@ -47,23 +47,23 @@ done
for i in "$@"; do
if [ "${i%=*}" == "--user" ]
then
USER="${i#*=}"
User="${i#*=}"
elif [ "${i%=*}" == "--port" ]
then
PORT="${i#*=}"
Port="${i#*=}"
elif [ "${i}" == "--version" ] || [ "${i}" == "-v" ]
then
echo "Prog ssh-local v.${VERSION}"
echo "Prog ssh-local v.${Version}"
exit 0
elif [ "${i}" == "--help" ] || [ "${i}" == "-h" ]
then
echo "$HELP_MESSAGE"
echo "$Help_message"
exit 0
fi
done
echo user=${USER}
echo port=${PORT}
echo try to connect with user=${User} and port=${Port}
echo port=${Port}
ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" -p ${PORT} ${USER}@localhost
ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" -p ${Port} ${User}@localhost

View file

@ -4,7 +4,7 @@
#RESULT_POSSIBLE=("init","start","start_backup","create","backup","restore","suppr")
# Constante d'éxecutions.
Version="0.6"
Version="0.6.1"
USAGE="vm-start [ NAME COMMAND [PARAMETER] ] [OPTION]
Script to manage virtual machine easily.
@ -151,7 +151,7 @@ RESTORE() {
read -r entry
if [[ $entry =~ ^[yY]$ ]]
then
cp ${MAIN_LOCATION}${LOCATION}${VMHOSTNAME}.cow.backup ${MAIN_LOCATION}${LOCATION}${VMHOSTNAME}.cow
cp -i ${MAIN_LOCATION}${LOCATION}${VMHOSTNAME}.cow.backup ${MAIN_LOCATION}${LOCATION}${VMHOSTNAME}.cow
echo "Done"
fi
}
@ -162,7 +162,7 @@ BACKUP() {
read -p "Are you sure you want to backup the volume? If you continue the previous backup will be lost (y/N) " -r entry
if [[ $entry =~ ^[yY]$ ]]
then
cp ${MAIN_LOCATION}${LOCATION}${VMHOSTNAME}.cow ${MAIN_LOCATION}${LOCATION}${VMHOSTNAME}.cow.backup
cp -i ${MAIN_LOCATION}${LOCATION}${VMHOSTNAME}.cow ${MAIN_LOCATION}${LOCATION}${VMHOSTNAME}.cow.backup
echo "Done"
fi
}