Commit 3078b5fd authored by Jondy Zhao's avatar Jondy Zhao

Add slapos-configure as startup item in the Windows

parent c164337f
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
# #
# It will do: # It will do:
# #
# 1. Remove virtual netcards installed by re6stnet # * Remove virtual netcards installed by re6stnet
# #
# 2. Remove service cron, cygserver and syslog-ng # * Remove service cron, cygserver and syslog-ng
# #
# * Remove slapos configure script from windows startup item
# #
# Remove virtual netcard installed by re6stnet # Remove virtual netcard installed by re6stnet
...@@ -30,6 +31,14 @@ for x in $(cygrunsrv --list) ; do ...@@ -30,6 +31,14 @@ for x in $(cygrunsrv --list) ; do
cygrunsrv -R $x cygrunsrv -R $x
done done
#
# Remove slapos-configure from windows startup item
#
slapos_run_key='\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
slapos_run_entry=SlapOS-Node
echo Removing startup item "$slapos_run_key\\$slapos_run_entry"
regtool -q unset "$slapos_run_key\\$slapos_run_entry"
echo Run pre-uninstall script successfully. echo Run pre-uninstall script successfully.
read -n 1 -t 60 -p "Press any key to exit..." read -n 1 -t 60 -p "Press any key to exit..."
exit 0 exit 0
......
...@@ -565,6 +565,20 @@ EOF ...@@ -565,6 +565,20 @@ EOF
echo Cron file $crontab_file created. echo Cron file $crontab_file created.
fi fi
#-------------------------------------------------
# Add slapos-configure to windows startup item
#-------------------------------------------------
slapos_run_key='\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
slapos_run_entry=SlapOS-Node
slapos_run_script=/etc/slapos/scripts/slapos-configure.sh
echo Checking startup item ...
regtool -q get "$slapos_run_key\\$slapos_run_entry" || \
regtool -q set "$slapos_run_key\\$slapos_run_entry" \
"\"$(cygpath -w /usr/bin/bash)\" --login -i $slapos_run_script" || \
show_error_exit "Failed to add slapos-configure.sh as windows startup item."
echo Startup item "$slapos_run_key\\$slapos_run_entry": $(regtool get "$slapos_run_key\\$slapos_run_entry")
echo
echo SlapOS Node configure successfully. echo SlapOS Node configure successfully.
read -n 1 -t 60 -p "Press any key to exit..." read -n 1 -t 60 -p "Press any key to exit..."
exit 0 exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment