-
Notifications
You must be signed in to change notification settings - Fork 0
/
apt-updist
executable file
·54 lines (45 loc) · 1.08 KB
/
apt-updist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
echo -e "\n *********************"
echo -e " * gw APT-GET runner *"
echo -e " *********************\n"
if [ $(id -u) -ne 0 ]; then
echo -e "Script must be run as root. Try 'sudo $0'\n"
exit 1
fi
echo "Running UPDATE.."
apt-get update
if [ $? -gt 0 ]; then
echo "ERROR during apt-get update! Exiting.."
exit 1
fi
echo -e "done.\n"
echo "Running DIST-UPGRADE.."
apt-get -y -f dist-upgrade
if [ $? -gt 0 ]; then
echo "ERROR during apt-get dist-upgrade! Exiting.."
exit 1
fi
echo -e "done.\n"
while (("$#")); do
echo "Running INSTALL for $1.."
apt-get -y install $1
if [ $? -gt 0 ]; then
echo "ERROR during apt-get install for $1!"
fi
echo -e "done.\n"
shift
done
echo "Running AUTOCLEAN.."
apt-get -y autoclean
echo -e "done.\n"
echo "Running AUTOREMOVE.."
apt-get -y autoremove
echo -e "done.\n"
if [ -x "$(which checkrestart)" ]; then
echo "Finally running CHECKRESTART to see what needs to be restartet.."
checkrestart
echo -e "done.\n"
else
echo "Skipping CHECKRESTART. Seems to be not available.."
fi
echo -e "** Finished APT-GET Runner! **\n"