Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- clear
- restartt(){
- clear
- echo Press 'l' to list the files in a user defined directory
- echo Press 'b' to backup a user defined directory
- echo Press 'u' to to change a defined user''s password
- echo Press 'x' to simply Exit
- }
- scriptt(){
- echo ---
- echo 'Please Select: l, b, u, x:'
- read R
- case $R in
- # Case Letter 'l'
- l)
- echo 'please define a directory you would like to list'
- read LST
- cd $LST
- #echo 'You are in directory' pwd
- ls
- scriptt
- ;;
- # Case Letter 'b'
- b)
- scriptt
- ;;
- # Case Letter 'x'
- x)
- exit
- ;;
- # Case Letter 'u'
- u)
- echo Please type a users name to change their password:;read U
- if [ "$USER" = "$U" ];then
- passwd
- restartt
- scriptt
- elif [[ "$USER" != "root" ]];then
- echo 'You are not root, you MUST be root to change password of "' $U '"'
- echo 'So, Please Enter Root Password:'
- su -c "passwd $U"
- fi
- restartt
- scriptt
- ;;
- esac
- }
- restartt
- scriptt
Add Comment
Please, Sign In to add comment