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)
|
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-09-15 15:52:02 -06:00
|
|
|
options+=("haveged" "Antropy generator" on)
|
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
|
2018-09-19 09:16:16 -06:00
|
|
|
if (lscpu | grep AMD) then
|
|
|
|
options+=("amd-ucode" "AMD microcode" on)
|
|
|
|
else
|
|
|
|
options+=("amd-ucode" "AMD microcode" off)
|
|
|
|
fi
|
2015-08-20 14:37:06 -06:00
|
|
|
options+=("net-snmp" "SNMP Server" off)
|
2018-09-29 17:16:35 -06:00
|
|
|
options+=("samba" "Server SMB" off)
|
2019-01-01 14:47:59 -07:00
|
|
|
if (dmesg |grep Bluetooth) then
|
|
|
|
options+=("bluez" "" on)
|
|
|
|
options+=("bluez-libs" "" on)
|
|
|
|
else
|
|
|
|
options+=("bluez" "" off)
|
|
|
|
options+=("bluez-libs" "" off)
|
|
|
|
fi
|
2015-08-20 14:37:06 -06:00
|
|
|
options+=("syslog-ng" "" off)
|
2015-11-01 13:34:07 -07:00
|
|
|
options+=("pkgstats" "" off)
|
2018-09-15 15:53:11 -06:00
|
|
|
options+=("ntp" "" off)
|
2015-08-20 14:37:06 -06:00
|
|
|
#options+=("rsyslog" "" off)
|
|
|
|
#options+=("systemd-readahead" "(AUR) boot improvement" off)
|
|
|
|
|
2022-11-10 14:27:23 -07:00
|
|
|
sel=$(dialog --backtitle "$apptitle" --title "Services Install" --cancel-button "Back" --checklist "" 0 0 0 \
|
2015-08-20 14:37:06 -06:00
|
|
|
"${options[@]}" \
|
|
|
|
3>&1 1>&2 2>&3)
|
|
|
|
if [ ! "$?" = "0" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for itm in $sel; do
|
|
|
|
case $itm in
|
2022-11-10 14:27:23 -07:00
|
|
|
"numlockon") ;;
|
|
|
|
"systemd-readahead") aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";;
|
2015-08-20 14:37:06 -06:00
|
|
|
*) pkg="$pkg $(echo $itm | sed 's/"//g')";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
instpkg "$pkg" "$aurpkg"
|
|
|
|
|
|
|
|
for itm in $sel; do
|
|
|
|
case $itm in
|
2022-11-10 14:27:23 -07:00
|
|
|
"networkmanager")
|
2015-08-20 14:37:06 -06:00
|
|
|
systemctl disable dhcpcd
|
|
|
|
if (svcenable NetworkManager) then
|
2019-05-15 18:34:06 -06:00
|
|
|
svcdisable dhcpcd
|
2015-08-20 14:37:06 -06:00
|
|
|
fi
|
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"openssh")
|
2015-08-20 14:37:06 -06:00
|
|
|
svcenable sshd "SSH Server"
|
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"cronie")
|
2015-08-20 14:37:06 -06:00
|
|
|
svcenable cronie
|
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"bluez")
|
2019-01-01 14:47:59 -07:00
|
|
|
svcenable bluetooth "Bluetooth Service"
|
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"ntp")
|
2015-08-20 14:37:06 -06:00
|
|
|
svcenable ntpd "NTP Server"
|
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"numlockon") script install/system/services/numlockon;;
|
|
|
|
"haveged")
|
2018-06-04 16:57:10 -06:00
|
|
|
svcenable haveged "Haveged"
|
2018-06-04 14:39:04 -06:00
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"syslog-ng")
|
2015-08-20 14:37:06 -06:00
|
|
|
#echo "ForwardToSyslog=yes" >> /etc/systemd/journald.conf
|
2018-09-21 14:58:21 -06:00
|
|
|
systemctl enable syslog-ng@default
|
2015-08-20 14:37:06 -06:00
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"rsyslog")
|
2015-08-20 14:37:06 -06:00
|
|
|
systemctl enable rsyslog
|
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"net-snmp")
|
2015-08-20 14:37:06 -06:00
|
|
|
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
|
2018-09-15 19:36:14 -06:00
|
|
|
editfile /etc/snmp/snmpd.conf
|
2015-08-20 14:37:06 -06:00
|
|
|
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
|
2018-09-15 19:36:14 -06:00
|
|
|
editfile /var/net-snmp/snmpd.conf
|
2015-08-20 14:37:06 -06:00
|
|
|
fi
|
|
|
|
svcenable snmpd "SNMP Server"
|
|
|
|
;;
|
2022-11-10 14:27:23 -07:00
|
|
|
"systemd-readahead")
|
2015-08-20 14:37:06 -06:00
|
|
|
svcenable systemd-readahead
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|