summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-05-05 15:32:25 -0400
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-05-05 15:32:25 -0400
commitc952055166eebbdb276836603f256483be4add3f (patch)
treee123f7210ffba8885953feb4314fe094d7bf6b63
parent6714b33254e1d62cc2528e54d83578c1a7b540fa (diff)
Updates scripts
-rwxr-xr-xpublic/thesiah.sh36
-rwxr-xr-xstatic/thesiah.sh36
2 files changed, 38 insertions, 34 deletions
diff --git a/public/thesiah.sh b/public/thesiah.sh
index 530efc1..7ff0865 100755
--- a/public/thesiah.sh
+++ b/public/thesiah.sh
@@ -171,21 +171,22 @@ pipinstall() {
# runit
initinstall() {
- maininstall "$1" "$2"
- case "$(readlink -f /sbin/init)" in
- "runit-init")
- maininstall "$1-runit" "runit: $2"
- ln -s /etc/runit/sv/"$1" /run/runit/service/ || error "Failed to sync $1 service."
- sv start "$1" || error "Failed to run $1 service."
+ initsys="$(readlink /sbin/init | awk -F'-' '{print $1}')"
+ initpkg="$1-$initsys"
+ whiptail --title "SI Installation" \
+ --infobox "Installing the package \`$1\` and the corresponding init package \'$initpkg'\ ($n of $total). $1 $initpkg $2" 9 70
+ installpkg "$1" && installpkg "$initpkg" || error "Failed to install package $1 and init package $initpkg"
+ case "$initsys" in
+ "runit")
+ ln -s /etc/runit/sv/"$1" /run/runit/service/ >/dev/null 2>&1 || error "Failed to add $1 service."
+ sv start "$1" >/dev/null 2>&1 || error "Failed to run $1 service."
;;
- "openrc-init")
- maininstall "$1-openrc" "openrc: $2"
- rc-update add "$1" default || error "Faild to add $1 service."
- rc-service "$1" start || error "Faild to start $1 service."
+ "openrc")
+ rc-update add "$1" default >/dev/null 2>&1 || error "Faild to add $1 service."
+ rc-service "$1" start >/dev/null 2>&1 || error "Faild to start $1 service."
;;
- "s6-svscan")
- maininstall "$1-s6" "s6: $2"
- s6-rc -u change "$1" || error "Failed to start $1 service."
+ "s6")
+ s6-rc -u change "$1" >/dev/null 2>&1 || error "Failed to start $1 service."
;;
esac
}
@@ -374,8 +375,6 @@ ntpd -q -g >/dev/null 2>&1
adduserandpass || error "Error adding username and/or password."
-mkdir -p /home/$name/{.config,Documents,Downloads,Music,Pictures,Videos} /home/$name/Media/{flash,personal,sda,sdb,sdc,sdd,storage} /home/$name/Torrents/{complete,incomplete} /home/$name/.local/{bin,share,src,state} >/dev/null 2>&1
-
[ -f /etc/sudoers.pacnew ] && cp /etc/sudoers.pacnew /etc/sudoers # Just in case
# Allow user to run sudo without password. Since AUR programs must be installed
@@ -480,9 +479,9 @@ addsudo
pamgnupg || exit 1
# Create an ecrypted folder
-[ -d "/home/$name/Media" ] || mkdir -p "/home/$name/Media"
+[ -d /home/"$name"/Media ] || mkdir -p /home/"$name"/Media && chown "$name":wheel /home/"$name"/Media
printf '\nyes\nyes\n' | mount -t ecryptfs Media Media -o passphrase_passwd="$epass1",ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_enable_filename_crypto=y,ecryptfs_passthrough=n || exit 1
-umount /home/$name/Media
+umount /home/"$name"/Media
# ufw set up
ufwsetup || error "Failed to set up ufw rules."
@@ -496,5 +495,8 @@ sed -Ei "s/^#(STOP_CHARGE_THRESH_BAT1=).*/\175/" /etc/tlp.conf
# Change /bin/sh from bash to dash
ln -sf dash /bin/sh
+mkdir -p /home/$name/{.config,Documents,Downloads,Music,Pictures,Videos} /home/$name/Media/{flash,personal,sda,sdb,sdc,sdd,storage} /home/$name/Torrents/{complete,incomplete} /home/$name/.local/{bin,share,src,state} >/dev/null 2>&1
+chown -R "$name":wheel /home/"$name"
+
# Last message! Install complete!
finalize
diff --git a/static/thesiah.sh b/static/thesiah.sh
index 530efc1..7ff0865 100755
--- a/static/thesiah.sh
+++ b/static/thesiah.sh
@@ -171,21 +171,22 @@ pipinstall() {
# runit
initinstall() {
- maininstall "$1" "$2"
- case "$(readlink -f /sbin/init)" in
- "runit-init")
- maininstall "$1-runit" "runit: $2"
- ln -s /etc/runit/sv/"$1" /run/runit/service/ || error "Failed to sync $1 service."
- sv start "$1" || error "Failed to run $1 service."
+ initsys="$(readlink /sbin/init | awk -F'-' '{print $1}')"
+ initpkg="$1-$initsys"
+ whiptail --title "SI Installation" \
+ --infobox "Installing the package \`$1\` and the corresponding init package \'$initpkg'\ ($n of $total). $1 $initpkg $2" 9 70
+ installpkg "$1" && installpkg "$initpkg" || error "Failed to install package $1 and init package $initpkg"
+ case "$initsys" in
+ "runit")
+ ln -s /etc/runit/sv/"$1" /run/runit/service/ >/dev/null 2>&1 || error "Failed to add $1 service."
+ sv start "$1" >/dev/null 2>&1 || error "Failed to run $1 service."
;;
- "openrc-init")
- maininstall "$1-openrc" "openrc: $2"
- rc-update add "$1" default || error "Faild to add $1 service."
- rc-service "$1" start || error "Faild to start $1 service."
+ "openrc")
+ rc-update add "$1" default >/dev/null 2>&1 || error "Faild to add $1 service."
+ rc-service "$1" start >/dev/null 2>&1 || error "Faild to start $1 service."
;;
- "s6-svscan")
- maininstall "$1-s6" "s6: $2"
- s6-rc -u change "$1" || error "Failed to start $1 service."
+ "s6")
+ s6-rc -u change "$1" >/dev/null 2>&1 || error "Failed to start $1 service."
;;
esac
}
@@ -374,8 +375,6 @@ ntpd -q -g >/dev/null 2>&1
adduserandpass || error "Error adding username and/or password."
-mkdir -p /home/$name/{.config,Documents,Downloads,Music,Pictures,Videos} /home/$name/Media/{flash,personal,sda,sdb,sdc,sdd,storage} /home/$name/Torrents/{complete,incomplete} /home/$name/.local/{bin,share,src,state} >/dev/null 2>&1
-
[ -f /etc/sudoers.pacnew ] && cp /etc/sudoers.pacnew /etc/sudoers # Just in case
# Allow user to run sudo without password. Since AUR programs must be installed
@@ -480,9 +479,9 @@ addsudo
pamgnupg || exit 1
# Create an ecrypted folder
-[ -d "/home/$name/Media" ] || mkdir -p "/home/$name/Media"
+[ -d /home/"$name"/Media ] || mkdir -p /home/"$name"/Media && chown "$name":wheel /home/"$name"/Media
printf '\nyes\nyes\n' | mount -t ecryptfs Media Media -o passphrase_passwd="$epass1",ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_enable_filename_crypto=y,ecryptfs_passthrough=n || exit 1
-umount /home/$name/Media
+umount /home/"$name"/Media
# ufw set up
ufwsetup || error "Failed to set up ufw rules."
@@ -496,5 +495,8 @@ sed -Ei "s/^#(STOP_CHARGE_THRESH_BAT1=).*/\175/" /etc/tlp.conf
# Change /bin/sh from bash to dash
ln -sf dash /bin/sh
+mkdir -p /home/$name/{.config,Documents,Downloads,Music,Pictures,Videos} /home/$name/Media/{flash,personal,sda,sdb,sdc,sdd,storage} /home/$name/Torrents/{complete,incomplete} /home/$name/.local/{bin,share,src,state} >/dev/null 2>&1
+chown -R "$name":wheel /home/"$name"
+
# Last message! Install complete!
finalize