2015-08-20 14:37:06 -06:00
|
|
|
#!/bin/bash
|
|
|
|
. ./lib
|
|
|
|
|
|
|
|
options=()
|
|
|
|
options+=("networkmanager" "Network Management" on)
|
|
|
|
options+=("openssh" "Server SSH" on)
|
|
|
|
options+=("cronie" "Cron tasks server" on)
|
|
|
|
options+=("ntp" "Client NTP for clock sync" on)
|
2017-12-16 13:27:13 -07:00
|
|
|
options+=("xdg-user-dirs" "Create user directories" on)
|
2015-08-20 14:37:06 -06:00
|
|
|
options+=("numlockon" "numlock on on tty" on)
|
2018-06-04 14:32:38 -06:00
|
|
|
options+=("haveged" "Antropy generator" off)
|
2016-01-11 12:56:02 -07:00
|
|
|
if (lscpu | grep Intel) then
|
|
|
|
options+=("intel-ucode" "Intel microcode" on)
|
|
|
|
else
|
|
|
|
options+=("intel-ucode" "Intel microcode" off)
|
|
|
|
fi
|
2015-08-20 14:37:06 -06:00
|
|
|
options+=("net-snmp" "SNMP Server" off)
|
|
|
|
options+=("syslog-ng" "" off)
|
2015-11-01 13:34:07 -07:00
|
|
|
options+=("pkgstats" "" off)
|
2015-08-20 14:37:06 -06:00
|
|
|
#options+=("rsyslog" "" off)
|
|
|
|
#options+=("systemd-readahead" "(AUR) boot improvement" off)
|
|
|
|
|
|
|
|
sel=$(whiptail --backtitle "$apptitle" --title "Services Install" --checklist "" --cancel-button "Back" 0 0 0 \
|
|
|
|
"${options[@]}" \
|
|
|
|
3>&1 1>&2 2>&3)
|
|
|
|
if [ ! "$?" = "0" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for itm in $sel; do
|
|
|
|
case $itm in
|
|
|
|
'"numlockon"') ;;
|
|
|
|
'"systemd-readahead"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";;
|
|
|
|
*) pkg="$pkg $(echo $itm | sed 's/"//g')";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
instpkg "$pkg" "$aurpkg"
|
|
|
|
|
|
|
|
for itm in $sel; do
|
|
|
|
case $itm in
|
|
|
|
'"networkmanager"')
|
|
|
|
systemctl disable dhcpcd
|
|
|
|
if (svcenable NetworkManager) then
|
|
|
|
svcdisable dhcpd
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
'"openssh"')
|
|
|
|
svcenable sshd "SSH Server"
|
|
|
|
;;
|
|
|
|
'"cronie"')
|
|
|
|
svcenable cronie
|
|
|
|
;;
|
|
|
|
'"ntp"')
|
|
|
|
svcenable ntpd "NTP Server"
|
|
|
|
;;
|
|
|
|
'"numlockon"') script install/system/services/numlockon;;
|
2018-06-04 14:39:04 -06:00
|
|
|
'"haveged"')
|
|
|
|
systemctl enable haveged
|
|
|
|
;;
|
2015-08-20 14:37:06 -06:00
|
|
|
'"syslog-ng"')
|
|
|
|
#echo "ForwardToSyslog=yes" >> /etc/systemd/journald.conf
|
|
|
|
systemctl enable syslog-ng
|
|
|
|
;;
|
|
|
|
'"rsyslog"')
|
|
|
|
systemctl enable rsyslog
|
|
|
|
;;
|
|
|
|
'"net-snmp"')
|
|
|
|
if (confirm "Create and edit /etc/snmp/snmpd.conf ?") then
|
|
|
|
mkdir /etc/snmp > /dev/null
|
|
|
|
echo "# SNMP Server Config" > /etc/snmp/snmpd.conf
|
|
|
|
echo "# ------------------" >> /etc/snmp/snmpd.conf
|
|
|
|
echo "" >> /etc/snmp/snmpd.conf
|
|
|
|
echo "# SNMP 1 and 2" >> /etc/snmp/snmpd.conf
|
|
|
|
echo "#rocommunity read_only_user" >> /etc/snmp/snmpd.conf
|
|
|
|
echo "#rwcommunity read_write_user" >> /etc/snmp/snmpd.conf
|
|
|
|
echo "" >> /etc/snmp/snmpd.conf
|
|
|
|
echo "# SNMP 3" >> /etc/snmp/snmpd.conf
|
|
|
|
echo "#rouser read_only_user" >> /etc/snmp/snmpd.conf
|
|
|
|
nano /etc/snmp/snmpd.conf
|
|
|
|
fi
|
|
|
|
if (confirm "Create and edit /var/net-snmp/snmpd.conf (for SNMPv3) ?") then
|
|
|
|
mkdir -p /var/net-snmp/ > /dev/null
|
|
|
|
echo "# Note : Clear text password will be encrypted when you restart snmpd." > /var/net-snmp/snmpd.conf
|
|
|
|
echo "" >> /var/net-snmp/snmpd.conf
|
|
|
|
echo "#createUser read_only_user SHA password1 AES password2" >> /var/net-snmp/snmpd.conf
|
|
|
|
nano /var/net-snmp/snmpd.conf
|
|
|
|
fi
|
|
|
|
svcenable snmpd "SNMP Server"
|
|
|
|
;;
|
|
|
|
'"systemd-readahead"')
|
|
|
|
svcenable systemd-readahead
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|