-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-debian-ubuntu.sh
More file actions
107 lines (87 loc) · 2.1 KB
/
setup-debian-ubuntu.sh
File metadata and controls
107 lines (87 loc) · 2.1 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
# Setting up new Linux system
# define exit codes
: ${DIALOG_OK=0}
: ${DIALOG_CANCEL=1}
# uncommment if proxy required:
#export http_proxy=''
#export https_proxy=''
# Install some apps
install_dialog () {
dpkg -s dialog &> /dev/null
if [ "$?" = "1" ];
then
echo install dialog as prerequisite....
apt install dialog -y
fi
}
install_apps () {
applications=$(dialog --checklist "Choose software" 20 30 30 \
vim . on \
screen . on \
fail2ban . off \
htop . off \
curl . off \
mc . off \
lshw . off \
moreutils . off \
# see iotop-c iotop . off \
mtr . off \
screenfetch . off \
freeipmi . off \
iptraf . off \
ttyload . off \
multitail . off \
lsof . off \
rsync . off \
git . off \
aria2c . off \
qemu-guest-agent . off \
monit . off \
ccze . off \
ffmpeg . off \
expect . off \
autossh . off \
sysstat . off \
tcpdump . off \
chkservice . \
#gotop
iotop-c . \
smartmontools . off \
httping . off \
netcat . off 2>&1 > /dev/tty)
return_value=$?
case $return_value in
$DIALOG_OK)
apt install $applications -y;;
$DIALOG_CANCEL)
exit
;;
esac
}
# if screen installed:
config_screen () {
dpkg -s screen &> /dev/null
if [ "$?" = "0" ];
then
echo GNU screen installed, downloading config to current user
# Don't overwite an existing config:
set -o noclobber
wget -O - https://gist.githubusercontent.com/gsmitheidw/6ec6eb2dce79fde80f51c7e98f17a327/raw/027c87b77841d24b3cc4421fc621a5413b51afa2/.screenrc > ~/.screenrc
fi
}
# Setup unattended upgrades
# setup_unattended {
# apt install unattended-upgrades apt-listchanges
# dpkg-reconfigure unattended-upgrades
# vim /etc/apt/apt.conf.d/50unattended-upgrades
# unattended-upgrade -d --dry-run
#}
#sed -i 's/"set background=dark/set background=dark/g' /etc/vim/vimrc
# call functions:
install_dialog
install_apps
config_screen
# setup_unattended
# markdown viewer:
# pip install mdv