-
Notifications
You must be signed in to change notification settings - Fork 49
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
1 parent
3416ce2
commit 5e21741
Showing
4 changed files
with
52 additions
and
0 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,48 @@ | ||
cd /www/ | ||
|
||
echo "Install missing Linux packages" | ||
|
||
yum install -y -q sysstat | ||
yum install -y -q procps-ng | ||
|
||
echo "Install NPM dependencies" | ||
npm install total4 2>/dev/null | ||
npm install dbms 2>/dev/null | ||
|
||
echo "Backing up old SuperAdmin: /www/superadmin_bk.zip" | ||
zip -r superadmin_bk.zip superadmin 2>/dev/null | ||
|
||
echo "Kills all running apps" | ||
pkill -f total | ||
|
||
mkdir superadmin_tmp | ||
cp /www/superadmin/databases/applications.json /www/superadmin_tmp/applications.json | ||
cp /www/superadmin/databases/stats.nosql /www/superadmin_tmp/stats.nosql | ||
cp /www/superadmin/databases/acmethumbprint.txt /www/superadmin_tmp/acmethumbprint.txt | ||
|
||
SA_PID=$(lsof -i :9999 | grep "LISTEN" | awk {'print $2'}) | ||
|
||
if [[ $SA_PID ]] | ||
then | ||
echo "Killing old instance of SuperAdmin" | ||
kill -9 $SA_PID | ||
fi | ||
|
||
rm -rf /www/superadmin/ | ||
mkdir -p /www/superadmin/logs/ | ||
|
||
cd /www/superadmin/ | ||
echo "Downloading of new version of SuperAdmin" | ||
wget "https://raw.githubusercontent.com/totaljs/superadmin_templates/main/superadmin.zip" 2>/dev/null | ||
unzip superadmin.zip | ||
rm superadmin.zip | ||
|
||
mkdir databases | ||
cp /www/superadmin_tmp/applications.json /www/superadmin/databases/applications.json | ||
cp /www/superadmin_tmp/stats.nosql /www/superadmin/databases/stats.nosql | ||
cp /www/superadmin_tmp/acmethumbprint.txt /www/superadmin/databases/acmethumbprint.txt | ||
|
||
echo "Running..." | ||
bash run.sh | ||
|
||
echo "Done!" |
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