ask for sudo, no su, and remove --version

This commit is contained in:
Can202 2021-06-12 13:52:27 -04:00
parent 49bb6ccc5b
commit 12ee33d8ae

View File

@ -1,14 +1,8 @@
#!/bin/sh #!/bin/sh
if [ $1 = "--version" ] echo "do you use sudo command?(y/n)"
then
echo "version v0.1"
exit
fi
echo "do you use su command?(y/n)"
read sucommand read sucommand
if [ $sucommand = y ] if [ $sucommand = n ]
then then
echo "I need your username to add to the sudo group, if you are agree put your password" echo "I need your username to add to the sudo group, if you are agree put your password"
echo echo
@ -16,13 +10,13 @@ then
echo added to the sudo group echo added to the sudo group
echo echo
echo echo
echo "restart the PC, and then say you don't use the su command" echo "restart the PC, and then say you use the sudo command"
echo echo
echo echo
read nothing read nothing
exit exit
else else
if [ $sucommand = n ] if [ $sucommand = y ]
then then
echo OK echo OK
else else
@ -34,7 +28,7 @@ fi
echo "this script works on Debian, Ubuntu, Linux Mint, etc. (apt)" echo "this script works on Debian, Ubuntu, Linux Mint, etc. (apt)"
echo "continue?(y/n)" echo "continue?(y/n)"
read debbased read debbased
if [ $debbased = n ] if [ $debbased = y ]
then then
echo abort echo abort
exit exit