admin tools

Created samedi 13 février 2016

Script d'installation d'utilitaire d'administration.

1 #! /bin/bash
2 ##Script d'installation d'utilitaires d'administration
3 ##et monotoring
4 ##
5 # In case ctrl+c is pressed, restore terminal color and prompt settings, then exit
6 function ctrl_c()
7 {
8 	echo
9 	echo "Exiting script..."
10 	echo
11 	tput sgr0
12 	stty $sttysettings
13 	exit 0
14 }
15 # If no su privileges available, try to get them
16 if [[ ! "$(whoami)" == "root" ]] ; then
17 	echo -e "\nordinatous et #!++ "
18 
19 	# No sudo available? Then we can't get su privs. Advise and exit
20 	if [[ $(which sudo) == "" ]] ; then
21 		echo "'sudo' package missing! Please install."
22 		echo "e.g.: apt-get install sudo"
23 		exit 1
24 	fi
25 
26 	echo "Requesting su permissions..."
27 	# Run this script with sudo privs
28 	sudo $0 $*
29 		# If running this script with su privs failed, advise to do so manually and exit
30 		if [[ $? > 0 ]] ; then
31 		echo
32 		echo "Acquiring su permission failed!"
33 		echo "Please run this script with sudo permissions!"
34 		echo "(e.g. 'sudo $0' or 'sudo bash $0')"
35 		echo
36 		exit 1
37 	fi
38 exit 0
39 fi
40 apt-get install most
41 apt-get install dnstop
42 apt-get install htop
43 apt-get install cpuinfo
44 apt-get install sysstat
45 apt-get install vim
46 apt-get install lynis
47 apt-get install rk-hunter
48 apt-get install manpages-fr manpages-fr-extra manpages-dev
49 exit 0
50 export PAGER="most"
51 export EDITOR="vim"
52 sources ~/home/$USER/.bashrc
53 exit 0
54 # Exit script
55 ctrl_c


Backlinks: Home:07) Script shell bash