22 April, 2016

Commannd line update...

Bash shell script for update your ubuntu debian box.

I make a little shell script that will update your ubuntu by command line [ cli ], easier..

you are welocome to ad some ideas to that script and post it on my blog...




#!/bin/bash

clear

echo ""
echo " Script will update Operating System"
echo ""
echo " Welcome, $USER! "
echo " .. now apt-get will run update "
echo ""
sleep 5s;
sudo apt-get update &&
clear &&

echo ""
echo " .. now apt-get will upgrade "
echo ""
sleep 5s;
sudo apt-get upgrade -y &&
clear &&

echo ""
echo " .. now apt-get will remove and clean "
echo ""
sleep 5s;
sudo apt-get autoremove -y &&
clear &&

echo ""
read -p " Updating GRUB $foo? [y/n] " answer
echo ""
# run 'yes' command
if [[ $answer = y ]] ; then
sudo update-grub ;
# run 'no' command

fi

clear
echo ""
echo " Your box is up to date.."
echo ""
sleep 5s;

echo ""
read -p "Reboot your system $foo? [y/n] " answer
echo ""

# run 'yes' command

if [[ $answer = y ]] ; then
sudo init 6 ;
echo ""
echo " ... rebooting... "
echo ""
sleep 5s;

fi

clear
echo ""
echo " bye..., $USER! "
echo ""

No comments: