Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ############################################################################################
- # PLEASE NOTE OPTIONS KILL_PROCESS IS ANOTHER SCRIPT OF MINE SHARED NOW BEFORE MAIN SCRIPT #
- ############################################################################################
- #
- #!/bin/bash
- # Author : v1ral_ITS
- process=`ps -u $USER | zenity --list --column "Please select a process to kill:" --text="List all $USER processes:" --width 450 --height 570`
- ans=`echo $?`
- if test "$ans" -eq "0" ;
- then
- select=`echo $process | cut -d" " -f1`
- kill $select
- ans1=`echo $?`
- if [ "$ans1" == "0" ] ;
- then
- select1=`echo $process | cut -d":" -f3 | cut -d" " -f2`
- echo | zenity --info --text="Process '$select1' with pid '$select' was killed!" --width 400 --height 150
- else
- echo | zenity --error --text="Process '$select1' with pid '$select' not found!" --width 200 --height 100
- fi
- exit 0
- fi
- if test "$ans" -eq "1" ;
- then
- echo | zenity --error --text="You have cancel" --width 200 --height 100
- exit 0
- fi
- #!/bin/bash
- #######################
- # Bash Menu Scripting #
- ################################
- # GLOBAL VARIABLES IN ALL CAPS #
- #########################################################################################
- #########################################################################################
- ## ##
- # v1ral_ITS | ImPerialTeKSolutions@outlook.com | www.pastebin.com/u/v1ral_ITS #
- ## ##
- #########################################################################################
- #########################################################################################
- # Console colors
- W='\033[0m' # white (normal)
- R='\033[31m' # red
- G='\033[32m' # green
- O='\033[33m' # orange
- B='\033[34m' # blue
- P='\033[35m' # purple
- C='\033[36m' # cyan
- GR='\033[37m' # gray
- #####################
- # START #
- #####################
- PS3='Please enter your choice: '
- options=("`echo -e $O Update`" "`echo -e $B Upgrade`" "`echo -e $C Install`" "`echo -e $G Autoremove`" "`echo -e $P Purge`" "`echo -e $W Kill_Processes`" "`echo -e $C Clear Screen`" "`echo -e $GR Enter Your Own Command`" "`echo -e $P Quit`")
- select opt in "${options[@]}"
- do
- case $opt in
- "`echo -e $O Update`")
- sudo apt-get -y update
- echo -e $C"Your options again are, press [E]nter \n `echo $options`"
- ;;
- "`echo -e $B Upgrade`")
- sudo apt-get -y upgrade
- echo -e $C"Your options again are, press [E]nter \n `echo $options`"
- ;;
- "`echo -e $C Install`")
- echo -n "What do you want to install?: "
- read INST
- sudo apt-get -y install $INST
- echo -e $C"Your options again are, press [E]nter \n `echo $options`"
- ;;
- "`echo -e $GR Autoremove`")
- sudo apt-get -y autoremove
- echo -e $C"Your options again are, press [E]nter \n `echo $options`"
- ;;
- "`echo -e $P Purge`")
- echo -n "What do you want to purge?: "
- read PGE
- sudo apt-get -y purge $PGE
- echo -e $C"Your options again are, press [E]nter \n `echo $options`"
- ;;
- "`echo -e $W Kill_Processes`")
- echo -e $R"`killps`"
- echo -e $C"Your options again are, press [E]nter \n `echo $options`"
- ;;
- "`echo -e $C Clear Screen`")
- echo -e $O"`clear`"
- echo -e $C"Your options again are, press [E]nter \n `echo $options`"
- ;;
- "`echo -e $GR Enter Your Own Command`")
- MSG=$(zenity --title "Terminal Command Entry" --entry )
- sudo $MSG
- echo -e $C"Your options again are, press [E]nter \n `echo $options`"
- ;;
- "`echo -e $P Quit`")
- break
- ;;
- *) echo invalid option;;
- esac
- done
- echo -en "Please Email us @ ImPerialTeKSolutions@outlook.com for any and all questions comments, freelance work, and any other projects. We like feedback, thanks!"
- sleep 4
- # Console colors ##############
- W='\033[0m' # white (normal) #
- R='\033[31m' # red #
- G='\033[32m' # green #
- O='\033[33m' # orange #
- B='\033[34m' # blue #
- P='\033[35m' # purple #
- C='\033[36m' # cyan #
- GR='\033[37m' # gray #
- ###############################
- # REMINDER #
- ###############################
- cd "`pwd`";
- echo -e \n\n\n`clear`;
- echo -e $GR" `date` ";
- echo -e $O" Shell Scripts Made For You........";
- echo -e $P" Your present working directory is `pwd`...";
- echo -e Inside....
- ls;
- echo -e $W"
- $R########################################################$G##################################################################
- $G##### * $R * ####
- $GR##### SHELL SCRIPTS MADE EASY FOR THE LINUX USER $C 2018_vet ImP.TeK_Solutions TM ####
- $G##### * $R * ####
- $R########################################################$G##################################################################
- "
- date
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement