Ask for confirmation before deleting the configuration
This commit is contained in:
parent
7910ba6dc9
commit
7e07cae7fe
46
src/ks-upa
46
src/ks-upa
|
@ -532,31 +532,49 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete the existing configuration.
|
# Delete the existing configuration.
|
||||||
if [ "$1" == "-r" ] ; then
|
if [ "${1}" == "-r" ] ; then
|
||||||
rm -rf ${dirConfig}/ks-upload-user
|
echo ""
|
||||||
rm -rf ${dirConfig}/ks-upload-pass
|
echo "* ks-upa (ks-tools) v${VERSION} (${M_DATE})"
|
||||||
rm -rf ${dirConfig}/ks-upload-server
|
echo ""
|
||||||
rm -rf ${dirConfig}/ks-upload-dirserver
|
echo -n "* [Default: n] Are you sure you want to delete the configuration? (y/n): " ; read confirm
|
||||||
rm -rf ${dirConfig}/ks-upload-dirlocal
|
if [ "${confirm}" == "y" ] ; then
|
||||||
exit
|
echo ""
|
||||||
|
echo "+ Removing USER file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-user
|
||||||
|
echo "+ Removing PASSWORD file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-pass
|
||||||
|
echo "+ Removing SERVER file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-server
|
||||||
|
echo "+ Removing SERVER PATH file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-dirserver
|
||||||
|
echo "+ Removing LOCAL PATH file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-dirlocal
|
||||||
|
echo "* Removed all configuration"
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "+ Remove configuration canceled"
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Show configuration file
|
# Show configuration file
|
||||||
if [ "$1" == "-c" ] ; then
|
if [ "${1}" == "-c" ] ; then
|
||||||
showConfig
|
showConfig
|
||||||
# Show configuration file
|
# Show configuration file
|
||||||
elif [ "$1" == "-e" ] ; then
|
elif [ "${1}" == "-e" ] ; then
|
||||||
editConfig
|
editConfig
|
||||||
# Show the version
|
# Show the version
|
||||||
elif [ "$1" == "-v" ] ; then
|
elif [ "${1}" == "-v" ] ; then
|
||||||
showVersion
|
showVersion
|
||||||
# Show the help
|
# Show the help
|
||||||
elif [ "$1" == "-h" ] ; then
|
elif [ "${1}" == "-h" ] ; then
|
||||||
showHelp
|
showHelp
|
||||||
elif [ "$1" == "-g" ] ; then
|
elif [ "${1}" == "-g" ] ; then
|
||||||
createConfig
|
createConfig
|
||||||
# Init
|
# Init
|
||||||
elif [ "$1" == "-i" ] ; then
|
elif [ "${1}" == "-i" ] ; then
|
||||||
# Start script
|
# Start script
|
||||||
createConfig
|
createConfig
|
||||||
user=$(cat ${dirConfig}/ks-upload-user)
|
user=$(cat ${dirConfig}/ks-upload-user)
|
||||||
|
|
34
src/ks-upf
34
src/ks-upf
|
@ -550,15 +550,33 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete the existing configuration.
|
# Delete the existing configuration.
|
||||||
if [ "$1" == "-r" ] ; then
|
if [ "${1}" == "-r" ] ; then
|
||||||
rm -rf ${dirConfig}/ks-upload-user
|
echo ""
|
||||||
rm -rf ${dirConfig}/ks-upload-pass
|
echo "* ks-upf (ks-tools) v${VERSION} (${M_DATE})"
|
||||||
rm -rf ${dirConfig}/ks-upload-server
|
echo ""
|
||||||
rm -rf ${dirConfig}/ks-upload-dirserver
|
echo -n "* [Default: n] Are you sure you want to delete the configuration? (y/n): " ; read confirm
|
||||||
rm -rf ${dirConfig}/ks-upload-dirlocal
|
if [ "${confirm}" == "y" ] ; then
|
||||||
exit
|
echo ""
|
||||||
|
echo "+ Removing USER file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-user
|
||||||
|
echo "+ Removing PASSWORD file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-pass
|
||||||
|
echo "+ Removing SERVER file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-server
|
||||||
|
echo "+ Removing SERVER PATH file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-dirserver
|
||||||
|
echo "+ Removing LOCAL PATH file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-dirlocal
|
||||||
|
echo "* Removed all configuration"
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "+ Remove configuration canceled"
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Show configuration file
|
# Show configuration file
|
||||||
if [ "$1" == "-c" ] ; then
|
if [ "$1" == "-c" ] ; then
|
||||||
showConfig
|
showConfig
|
||||||
|
|
34
src/ks-upr
34
src/ks-upr
|
@ -492,15 +492,33 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete the existing configuration.
|
# Delete the existing configuration.
|
||||||
if [ "$1" == "-r" ] ; then
|
if [ "${1}" == "-r" ] ; then
|
||||||
rm -rf ${dirConfig}/ks-upload-user
|
echo ""
|
||||||
rm -rf ${dirConfig}/ks-upload-pass
|
echo "* ks-upr (ks-tools) v${VERSION} (${M_DATE})"
|
||||||
rm -rf ${dirConfig}/ks-upload-server
|
echo ""
|
||||||
rm -rf ${dirConfig}/ks-upload-dirserver
|
echo -n "* [Default: n] Are you sure you want to delete the configuration? (y/n): " ; read confirm
|
||||||
rm -rf ${dirConfig}/ks-upload-dirlocal
|
if [ "${confirm}" == "y" ] ; then
|
||||||
exit
|
echo ""
|
||||||
|
echo "+ Removing USER file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-user
|
||||||
|
echo "+ Removing PASSWORD file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-pass
|
||||||
|
echo "+ Removing SERVER file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-server
|
||||||
|
echo "+ Removing SERVER PATH file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-dirserver
|
||||||
|
echo "+ Removing LOCAL PATH file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-dirlocal
|
||||||
|
echo "* Removed all configuration"
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "+ Remove configuration canceled"
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Show configuration file
|
# Show configuration file
|
||||||
if [ "$1" == "-c" ] ; then
|
if [ "$1" == "-c" ] ; then
|
||||||
showConfig
|
showConfig
|
||||||
|
|
34
src/ks-upv
34
src/ks-upv
|
@ -533,15 +533,33 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete the existing configuration.
|
# Delete the existing configuration.
|
||||||
if [ "$1" == "-r" ] ; then
|
if [ "${1}" == "-r" ] ; then
|
||||||
rm -rf ${dirConfig}/ks-upload-user
|
echo ""
|
||||||
rm -rf ${dirConfig}/ks-upload-pass
|
echo "* ks-upv (ks-tools) v${VERSION} (${M_DATE})"
|
||||||
rm -rf ${dirConfig}/ks-upload-server
|
echo ""
|
||||||
rm -rf ${dirConfig}/ks-upload-dirserver
|
echo -n "* [Default: n] Are you sure you want to delete the configuration? (y/n): " ; read confirm
|
||||||
rm -rf ${dirConfig}/ks-upload-dirlocal
|
if [ "${confirm}" == "y" ] ; then
|
||||||
exit
|
echo ""
|
||||||
|
echo "+ Removing USER file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-user
|
||||||
|
echo "+ Removing PASSWORD file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-pass
|
||||||
|
echo "+ Removing SERVER file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-server
|
||||||
|
echo "+ Removing SERVER PATH file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-dirserver
|
||||||
|
echo "+ Removing LOCAL PATH file configuration..."
|
||||||
|
rm -rf ${dirConfig}/ks-upload-dirlocal
|
||||||
|
echo "* Removed all configuration"
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "+ Remove configuration canceled"
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Show configuration file
|
# Show configuration file
|
||||||
if [ "$1" == "-c" ] ; then
|
if [ "$1" == "-c" ] ; then
|
||||||
showConfig
|
showConfig
|
||||||
|
|
Loading…
Reference in New Issue
Block a user