streamline services installation process
This commit is contained in:
-30
@@ -25,15 +25,7 @@ install_service()
|
|||||||
|
|
||||||
local service="$1"
|
local service="$1"
|
||||||
|
|
||||||
if [ -e "/var/service/$service" ]; then
|
|
||||||
sudo rm -rf "/var/service/$service"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if sudo ln -s "/etc/sv/$service" "/var/service/"; then
|
if sudo ln -s "/etc/sv/$service" "/var/service/"; then
|
||||||
if [ ! -f "/etc/sv/$service/down" ]; then
|
|
||||||
sudo touch "/etc/sv/$service/down"
|
|
||||||
fi
|
|
||||||
|
|
||||||
gum style --foreground 10 "✓ $service"
|
gum style --foreground 10 "✓ $service"
|
||||||
else
|
else
|
||||||
gum style --foreground 9 "✗ $service"
|
gum style --foreground 9 "✗ $service"
|
||||||
@@ -56,28 +48,6 @@ remove_service()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_service()
|
|
||||||
{
|
|
||||||
|
|
||||||
if [ "$#" -eq 0 ]; then
|
|
||||||
echo echo "✗ no service provided!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local service="$1"
|
|
||||||
|
|
||||||
if [ -f "/etc/sv/$service/down" ]; then
|
|
||||||
sudo rm "/etc/sv/$service/down"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if sudo sv up "$service"; then
|
|
||||||
gum style --foreground 10 "✓ $service"
|
|
||||||
else
|
|
||||||
gum style --foreground 9 "✗ $service"
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
install_dotfiles()
|
install_dotfiles()
|
||||||
{
|
{
|
||||||
if [ $# -ne 3 ]; then
|
if [ $# -ne 3 ]; then
|
||||||
|
|||||||
+1
-7
@@ -9,16 +9,10 @@ GROUPS_DIR="$DESOLATE_DIR/groups"
|
|||||||
. "$HOME/.desolate/helpers.sh"
|
. "$HOME/.desolate/helpers.sh"
|
||||||
|
|
||||||
. "$PACKAGES_DIR/install.sh"
|
. "$PACKAGES_DIR/install.sh"
|
||||||
. "$SERVICES_DIR/install.sh"
|
|
||||||
. "$DOTFILES_DIR/install.sh"
|
. "$DOTFILES_DIR/install.sh"
|
||||||
. "$DESOLATE_DIR/assign-groups.sh"
|
. "$DESOLATE_DIR/assign-groups.sh"
|
||||||
. "$SERVICES_DIR/run.sh"
|
. "$SERVICES_DIR/install.sh"
|
||||||
|
|
||||||
gum style --foreground 15 "
|
gum style --foreground 15 "
|
||||||
Done!
|
Done!
|
||||||
"
|
"
|
||||||
|
|
||||||
if [ -f /tmp/reboot ]; then
|
|
||||||
sudo rm /tmp/reboot
|
|
||||||
sudo reboot
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ if [ $(command -v zsh) >/dev/null 2>&1 ]; then
|
|||||||
gum style --foreground 9 "✗ failed to change shell to zsh: $error"
|
gum style --foreground 9 "✗ failed to change shell to zsh: $error"
|
||||||
else
|
else
|
||||||
gum style --foreground 15 "✓ changed shell to zsh"
|
gum style --foreground 15 "✓ changed shell to zsh"
|
||||||
sudo touch /tmp/reboot
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
+2
-1
@@ -8,7 +8,8 @@ INSTALLING SERVICES:
|
|||||||
|
|
||||||
. "$SERVICES_DIR/install-chronyd.sh"
|
. "$SERVICES_DIR/install-chronyd.sh"
|
||||||
. "$SERVICES_DIR/install-dbus.sh"
|
. "$SERVICES_DIR/install-dbus.sh"
|
||||||
. "$SERVICES_DIR/install-emptty.sh"
|
|
||||||
. "$SERVICES_DIR/install-seatd.sh"
|
. "$SERVICES_DIR/install-seatd.sh"
|
||||||
. "$SERVICES_DIR/install-socklog-unix.sh"
|
. "$SERVICES_DIR/install-socklog-unix.sh"
|
||||||
. "$SERVICES_DIR/install-nanoklogd.sh"
|
. "$SERVICES_DIR/install-nanoklogd.sh"
|
||||||
|
|
||||||
|
. "$SERVICES_DIR/install-emptty.sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user