Files
quectel-rgmii-toolkit/simpleupdates/scripts/update_simpleupdates.sh
iamromulan 7f17818a9c Simpleupdates Phase 1
-Moved several installation functions to individual scripts that will run as systemd processes for updating/installing; This is phase 1 in creating an automatic update system
-Merged ttyd into simpleadmin as it is now part of simpleadmin as "console"
2024-04-13 21:56:39 -04:00

47 lines
937 B
Bash

#!/bin/bash
# WORK IN PROGRESS
# Define constants
GITUSER="iamromulan"
GITTREE="development"
DIR_NAME="simpleupdates"
SERVICE_FILE="/lib/systemd/system/install_simpleupdates.service"
SERVICE_NAME="install_simpleupdates"
TMP_SCRIPT="/tmp/install_simpleupdates.sh"
LOG_FILE="/tmp/install_simpleupdates.log"
# Tmp Script dependent constants
# Create the systemd service file
cat <<EOF > "$SERVICE_FILE"
[Unit]
Description=Update $DIR_NAME temporary service
[Service]
Type=oneshot
ExecStart=/bin/bash $TMP_SCRIPT > $LOG_FILE 2>&1
[Install]
WantedBy=multi-user.target
EOF
# Create and populate the temporary shell script for installation
cat <<EOF > "$TMP_SCRIPT"
#!/bin/bash
install_simpleupdates() {
# CONTENT
}
install_simpleupdates
exit 0
EOF
# Make the temporary script executable
chmod +x "$TMP_SCRIPT"
# Reload systemd to recognize the new service and start the update
systemctl daemon-reload
systemctl start $SERVICE_NAME