diff --git a/simpleupdates/scripts/update_tailscale.sh b/simpleupdates/scripts/update_tailscale.sh index 1790e7c..7179e31 100644 --- a/simpleupdates/scripts/update_tailscale.sh +++ b/simpleupdates/scripts/update_tailscale.sh @@ -12,6 +12,21 @@ LOG_FILE="/tmp/install_sshd.log" # Tmp Script dependent constants TAILSCALE_DIR="/usrdata/tailscale/" TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd" +# Function to remount file system as read-write +remount_rw() { + mount -o remount,rw / +} + +# Function to remount file system as read-only +remount_ro() { + mount -o remount,ro / +} + +# Installation Prep +remount_rw +systemctl daemon-reload +rm $SERVICE_FILE > /dev/null 2>&1 +rm $SERVICE_NAME > /dev/null 2>&1 # Create the systemd service file cat < "$SERVICE_FILE" @@ -36,6 +51,16 @@ GITTREE="development" TAILSCALE_DIR="/usrdata/tailscale/" TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd" +# Function to remount file system as read-write +remount_rw() { + mount -o remount,rw / +} + +# Function to remount file system as read-only +remount_ro() { + mount -o remount,ro / +} + install_update_tailscale() { echo "Checking if Tailscale is already installed..." if [ -f "$TAILSCALE_DIR/tailscale" ]; then