3 Attachment(s)
Update/Upgrade all the things with a shortcut key.
If you are like me, you wake up every morning, power up your
machine and run the same commands.
Something along the lines of....
apt-get update
apt-get upgrade
apt-get dist-upgrade
msfupdate
cd /opt/metasploit/msf3/set
./set-update
...so I wrote a nice neat BASH script to do it for me.
I just thought that it was about time to start sharing some of the simple things I found to make life easier.
I am running BackTrack 5 r3 gnome
Here is the script....
Code:
#!/bin/bash
#IJNNJI
clear
echo
echo -e "\033[36m[*]\033[36m" "\033[32mChecking for updates....................\033[0m"
echo
sleep 1
apt-get update
sleep 2
clear
echo
echo -e "\033[36m[*]\033[36m" "\033[32mUpgrading packages......................\033[0m"
echo
sleep 1
apt-get upgrade
sleep 2
clear
echo
echo -e "\033[36m[*]\033[36m" "\033[32mUpgrading distro........................\033[0m"
echo
sleep 1
apt-get dist-upgrade
sleep 2
clear
echo
echo -e "\033[36m[*]\033[36m" "\033[32mUpdating Metasploit....................\033[0m"
echo
sleep 1
msfupdate
sleep 2
clear
echo
echo -e "\033[36m[*]\033[36m" "\033[32mUpdating The Social Engineering Toolkit\033[0m"
echo
cd /opt/metasploit/msf3/set
./set-update
Simply copy the code and paste it into a file with the name of your choosing.
I've named it apt.sh
Next chmod the file
And now you can execute the script.
Then I thought this it a great script to use with a shortcut key.
So follow along if you'd like.
Click the System menu on your panel.
Hover over Preferences and select Keyboard Shortcuts.
Attachment 1307
In the Keyboard Shortcuts window click Add
Attachment 1308
Name the shortcut whatever you would like.
In the Command text box enter the following command with the path and
name that you have given your script. I am using the path /root/shortcuts/apt.sh
The follow command will open a new terminal and start the bash script.
Code:
gnome-terminal -x /root/shortcuts/apt.sh start
click Apply
Finally it is time to pick a shortcut key to start the script.
I use the modifier key + u or "windows key" + u
Click on the left-hand side of the custom script you have just added, under the
Shortcuts column. Now just press the key combo you would like to use to
start the script. When you are done click Close.
Attachment 1309
Now Updating is as easy as pressing a button.
I hope this makes some lives easier!
Re: Update/Upgrade all the things with a shortcut key.
Awesome post man. Been a while since I have used BT and I just put it on my VM and was thinking "hmm I see no option for update..hmm I think I might have to apt it to death" you just made my day/night a lot easier lol. Quick qustion and this is probably a dumb one but I have a migraine and am tired since it's a .sh exacutable could you also put a shortcut on say the desktop for simple click update as well?
Re: Update/Upgrade all the things with a shortcut key.
Re: Update/Upgrade all the things with a shortcut key.
Apt-fast looks pretty cool I will be checking it out today. Thanks for the link.