obosdi-pkg/install/system/services/menu

115 lines
3.2 KiB
Text
Raw Normal View History

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
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)
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)
options+=("ntp" "" 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
;;
2019-01-01 14:47:59 -07:00
'"bluez"')
svcenable bluetooth "Bluetooth Service"
;;
2015-08-20 14:37:06 -06:00
'"ntp"')
svcenable ntpd "NTP Server"
;;
'"numlockon"') script install/system/services/numlockon;;
2018-06-04 14:39:04 -06:00
'"haveged"')
2018-06-04 16:57:10 -06:00
svcenable haveged "Haveged"
2018-06-04 14:39:04 -06:00
;;
2015-08-20 14:37:06 -06:00
'"syslog-ng"')
#echo "ForwardToSyslog=yes" >> /etc/systemd/journald.conf
systemctl enable syslog-ng@default
2015-08-20 14:37:06 -06:00
;;
'"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
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"
;;
'"systemd-readahead"')
svcenable systemd-readahead
;;
esac
done
exit 0