-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#!/bin/bash | ||
|
||
# this script sets up the SetupHelper service | ||
# This service provides automatic and manual updates for Venus modificaiton packages | ||
# | ||
|
||
#### following lines incorporate SetupHelper utilities into this script | ||
# Refer to the SetupHelper ReadMe file for details. | ||
|
||
source "/data/SetupHelper/CommonResources" | ||
|
||
#### end of lines to include SetupHelper | ||
|
||
#### running manually and OK to proceed - prompt for input | ||
if [ $scriptAction == 'NONE' ] ; then | ||
# display innitial message | ||
echo | ||
echo "This package provides support functions and utilities for Venus modificaiton packages" | ||
echo "Packages are automatically reinstalled following a Venus OS update" | ||
echo "Packages may also be automatically updated from GitHub" | ||
echo " or a USB stick" | ||
echo "Prevouslly uninstalled packages can also be installed and configured" | ||
echo " as an option from the menu either from GitHub or from a USB stick" | ||
echo | ||
echo "If internet access is not available, you can manually update/install from a USB stick" | ||
echo "Note: installing from a USB stick disables automatic GitHub updates" | ||
echo | ||
|
||
if [ -f "$setupOptionsDir/optionsSet" ]; then | ||
enableReinstall=true | ||
else | ||
enableReinstall=false | ||
fi | ||
|
||
response='' | ||
fullPrompt=true | ||
while true; do | ||
if $fullPrompt ; then | ||
echo | ||
echo "Available actions:" | ||
echo " Install and activate (i)" | ||
if $enableReinstall ; then | ||
echo " Reinstall (r) based on options provided at last install" | ||
fi | ||
echo " Uninstall (u) and restores all files to stock" | ||
echo " Quit (q) without further action" | ||
echo " Display setup log (s) outputs the last 100 lines of the log" | ||
echo | ||
echo " Enable/disable automatic GitHub package updates (g)" | ||
echo " Manually install packages from GitHub or USB stick (p)" | ||
echo | ||
fullPrompt=false | ||
fi | ||
/bin/echo -n "Choose an action from the list above: " | ||
read response | ||
case $response in | ||
[iI]*) | ||
scriptAction='INSTALL' | ||
break;; | ||
[rR]*) | ||
if $enableReinstall ; then | ||
scriptAction='INSTALL' | ||
break | ||
fi | ||
;; | ||
[uU]*) | ||
scriptAction='UNINSTALL' | ||
break | ||
;; | ||
[qQ]*) | ||
exit | ||
;; | ||
[sS]*) | ||
displayLog $setupLogFile | ||
;; | ||
[gG]*) | ||
if [ -f "$setupOptionsDir/autoGitHubUpdate" ]; then | ||
echo "Automatic GitHub updates are currently ENABLED" | ||
else | ||
echo "Automatic GitHub updates are currently disabled" | ||
fi | ||
read -p "Enable (e) / Disable (d) / no change(cr)?: " response | ||
if [ ! -z $response ]; then | ||
if [ $response == 'e' ] || [ $response == 'E' ]; then | ||
logMessage "enabling automatic GitHub package updates" | ||
touch "$setupOptionsDir/autoGitHubUpdate" | ||
elif [ $response == 'd' ] || [ $response == 'D' ]; then | ||
logMessage "disabling automatic GitHub package updates" | ||
rm -f "$setupOptionsDir/autoGitHubUpdate" | ||
fi | ||
fi | ||
;; | ||
[pP]*) | ||
"$scriptDir/packageInstaller" | ||
fullPrompt=true | ||
;; | ||
*) | ||
esac | ||
done | ||
|
||
# next step is to install | ||
scriptAction='INSTALL' | ||
fi | ||
|
||
if [ $scriptAction == 'INSTALL' ] ; then | ||
installService $packageName | ||
fi | ||
|
||
if [ $scriptAction == 'UNINSTALL' ] ; then | ||
removeService $packageName | ||
fi | ||
|
||
# thats all folks - SCRIPT EXITS INSIDE THE FUNCTION | ||
endScript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1624826016 | ||
1626985917 |