summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-07-21 14:16:39 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-07-21 14:16:39 +0900
commit51c70f2cd9fb983abbd6d5443c02febc08758c62 (patch)
tree6579a60c8dd75af9cb443920ceb9c33bf008cb28
parente95ecd3e4853b82464f7a355ced2cb7c68a82fbf (diff)
Init
-rwxr-xr-xpublic/thesiah.sh33
-rwxr-xr-xstatic/thesiah.sh33
2 files changed, 48 insertions, 18 deletions
diff --git a/public/thesiah.sh b/public/thesiah.sh
index 7a137fe..dfe190c 100755
--- a/public/thesiah.sh
+++ b/public/thesiah.sh
@@ -221,8 +221,8 @@ installationloop() {
"A") aurinstall "$program" "$comment" ;;
"I")
case "$(readlink -f /sbin/init)" in
- *systemd*) initinstall "$program" "$comment" ;;
- *) maininstall "$program" ;;
+ *systemd*) maininstall "$program" "$comment" ;;
+ *) initinstall "$program" "$comment" ;;
esac
;;
"G") gitmakeinstall "$program" "$comment" ;;
@@ -367,7 +367,9 @@ ecryptfssetup() {
ufwsetup() {
whiptail --infobox "Setting up ufw..." 7 50
[ -x "$(command -v "ufw")" ] || installpkg ufw
- pacman -Qq ufw-"$initsys" >/dev/null 2>&1 || installpkg ufw-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq ufw-"$initsys" >/dev/null 2>&1 || installpkg ufw-"$initsys"
+ }
sleep 1
ufw --force reload >/dev/null 2>&1
ufw default deny incoming >/dev/null 2>&1
@@ -409,7 +411,9 @@ ufwsetup() {
sambasetup() {
whiptail --infobox "Setting up samba..." 7 50
[ -x "$(command -v "samba")" ] || installpkg samba
- pacman -Qq samba-"$initsys" >/dev/null 2>&1 || installpkg samba-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq samba-"$initsys" >/dev/null 2>&1 || installpkg samba-"$initsys"
+ }
sleep 1
ufw allow 137/tcp >/dev/null 2>&1
ufw allow 137/udp >/dev/null 2>&1
@@ -448,7 +452,9 @@ sambasetup() {
bluezsetup() {
whiptail --infobox "Setting up bluetooth..." 7 50
pacman -Qq bluez >/dev/null 2>&1 || installpkg bluez
- pacman -Qq bluez-"$initsys" >/dev/null 2>&1 || installpkg bluez-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq bluez-"$initsys" >/dev/null 2>&1 || installpkg bluez-"$initsys"
+ }
sleep 3
case "$initsys" in
"runit")
@@ -472,7 +478,9 @@ bluezsetup() {
cronsetup() {
whiptail --infobox "Setting up cronjob..." 7 50
pacman -Qq cronie >/dev/null 2>&1 || installpkg cronie
- pacman -Qq cronie-"$initsys" >/dev/null 2>&1 || installpkg cronie-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq cronie-"$initsys" >/dev/null 2>&1 || installpkg cronie-"$initsys"
+ }
sleep 1
case "$initsys" in
"runit")
@@ -504,7 +512,9 @@ cronsetup() {
tlpsetup() {
whiptail --infobox "Setting up tlp..." 7 50
[ -x "$(command -v "tlp")" ] || installpkg tlp
- pacman -Qq tlp-"$initsys" >/dev/null 2>&1 || installpkg tlp-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq tlp-"$initsys" >/dev/null 2>&1 || installpkg tlp-"$initsys"
+ }
sleep 1
echo "TLP_DEFAULT_MODE=AC
START_CHARGE_THRESH_BAT0=20
@@ -542,7 +552,9 @@ bbswitchsetup() {
sshsetup() {
whiptail --infobox "Setting up ssh..." 7 50
[ -x "$(command -v "ssh")" ] || installpkg openssh
- pacman -Qq openssh-"$initsys" >/dev/null 2>&1 || installpkg openssh-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq openssh-"$initsys" >/dev/null 2>&1 || installpkg openssh-"$initsys"
+ }
sleep 1
sed -Ei "s/^#?(PasswordAuthentication).*/\1 no/;s/^#?(UsePAM).*/\1 no/" /etc/ssh/sshd_config
case "$initsys" in
@@ -567,7 +579,9 @@ sshsetup() {
vpnsetup() {
whiptail --infobox "Setting up vpn..." 7 50
[ -x "$(command -v "openvpn")" ] || installpkg openvpn
- pacman -Qq openvpn-"$initsys" >/dev/null 2>&1 || installpkg openvpn-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq openvpn-"$initsys" >/dev/null 2>&1 || installpkg openvpn-"$initsys"
+ }
pacman -Qq networkmanager-openvpn >/dev/null 2>&1 || installpkg networkmanager-openvpn
sleep 3
nmcli connection import type openvpn file /home/"$name"/.dotfiles/ar/.config/openvpn/thesiah.ovpn >/dev/null 2>&1
@@ -766,6 +780,7 @@ pamgnupg
# Set up ecryptfs
ecryptfssetup
+
# Set up ufw
ufwsetup
diff --git a/static/thesiah.sh b/static/thesiah.sh
index 7a137fe..dfe190c 100755
--- a/static/thesiah.sh
+++ b/static/thesiah.sh
@@ -221,8 +221,8 @@ installationloop() {
"A") aurinstall "$program" "$comment" ;;
"I")
case "$(readlink -f /sbin/init)" in
- *systemd*) initinstall "$program" "$comment" ;;
- *) maininstall "$program" ;;
+ *systemd*) maininstall "$program" "$comment" ;;
+ *) initinstall "$program" "$comment" ;;
esac
;;
"G") gitmakeinstall "$program" "$comment" ;;
@@ -367,7 +367,9 @@ ecryptfssetup() {
ufwsetup() {
whiptail --infobox "Setting up ufw..." 7 50
[ -x "$(command -v "ufw")" ] || installpkg ufw
- pacman -Qq ufw-"$initsys" >/dev/null 2>&1 || installpkg ufw-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq ufw-"$initsys" >/dev/null 2>&1 || installpkg ufw-"$initsys"
+ }
sleep 1
ufw --force reload >/dev/null 2>&1
ufw default deny incoming >/dev/null 2>&1
@@ -409,7 +411,9 @@ ufwsetup() {
sambasetup() {
whiptail --infobox "Setting up samba..." 7 50
[ -x "$(command -v "samba")" ] || installpkg samba
- pacman -Qq samba-"$initsys" >/dev/null 2>&1 || installpkg samba-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq samba-"$initsys" >/dev/null 2>&1 || installpkg samba-"$initsys"
+ }
sleep 1
ufw allow 137/tcp >/dev/null 2>&1
ufw allow 137/udp >/dev/null 2>&1
@@ -448,7 +452,9 @@ sambasetup() {
bluezsetup() {
whiptail --infobox "Setting up bluetooth..." 7 50
pacman -Qq bluez >/dev/null 2>&1 || installpkg bluez
- pacman -Qq bluez-"$initsys" >/dev/null 2>&1 || installpkg bluez-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq bluez-"$initsys" >/dev/null 2>&1 || installpkg bluez-"$initsys"
+ }
sleep 3
case "$initsys" in
"runit")
@@ -472,7 +478,9 @@ bluezsetup() {
cronsetup() {
whiptail --infobox "Setting up cronjob..." 7 50
pacman -Qq cronie >/dev/null 2>&1 || installpkg cronie
- pacman -Qq cronie-"$initsys" >/dev/null 2>&1 || installpkg cronie-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq cronie-"$initsys" >/dev/null 2>&1 || installpkg cronie-"$initsys"
+ }
sleep 1
case "$initsys" in
"runit")
@@ -504,7 +512,9 @@ cronsetup() {
tlpsetup() {
whiptail --infobox "Setting up tlp..." 7 50
[ -x "$(command -v "tlp")" ] || installpkg tlp
- pacman -Qq tlp-"$initsys" >/dev/null 2>&1 || installpkg tlp-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq tlp-"$initsys" >/dev/null 2>&1 || installpkg tlp-"$initsys"
+ }
sleep 1
echo "TLP_DEFAULT_MODE=AC
START_CHARGE_THRESH_BAT0=20
@@ -542,7 +552,9 @@ bbswitchsetup() {
sshsetup() {
whiptail --infobox "Setting up ssh..." 7 50
[ -x "$(command -v "ssh")" ] || installpkg openssh
- pacman -Qq openssh-"$initsys" >/dev/null 2>&1 || installpkg openssh-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq openssh-"$initsys" >/dev/null 2>&1 || installpkg openssh-"$initsys"
+ }
sleep 1
sed -Ei "s/^#?(PasswordAuthentication).*/\1 no/;s/^#?(UsePAM).*/\1 no/" /etc/ssh/sshd_config
case "$initsys" in
@@ -567,7 +579,9 @@ sshsetup() {
vpnsetup() {
whiptail --infobox "Setting up vpn..." 7 50
[ -x "$(command -v "openvpn")" ] || installpkg openvpn
- pacman -Qq openvpn-"$initsys" >/dev/null 2>&1 || installpkg openvpn-"$initsys"
+ [ ! "$initsys" = "systemd" ] && {
+ pacman -Qq openvpn-"$initsys" >/dev/null 2>&1 || installpkg openvpn-"$initsys"
+ }
pacman -Qq networkmanager-openvpn >/dev/null 2>&1 || installpkg networkmanager-openvpn
sleep 3
nmcli connection import type openvpn file /home/"$name"/.dotfiles/ar/.config/openvpn/thesiah.ovpn >/dev/null 2>&1
@@ -766,6 +780,7 @@ pamgnupg
# Set up ecryptfs
ecryptfssetup
+
# Set up ufw
ufwsetup