Skip to content

Commit

Permalink
Updated scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
petersirka committed Dec 10, 2020
1 parent 3416ce2 commit 5e21741
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions install-centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ if [ "$userConsent" == "y" ]; then
yum install -y -q git
yum install -y -q lsof
yum install -y -q socat
yum install -y -q sysstat
yum install -y -q procps
curl https://get.acme.sh | sh
mkdir /www/
mkdir /www/logs/
Expand Down
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ if [ "$userConsent" == "y" ]; then
apt-get install -y lsof
apt-get install -y socat
apt-get install -y sysstat
apt-get install -y procps
curl https://get.acme.sh | sh
mkdir /www/
mkdir /www/logs/
Expand Down
48 changes: 48 additions & 0 deletions update-centos.sh
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!"
1 change: 1 addition & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cd /www/
echo "Install missing Linux packages"

apt-get install -y sysstat
apt-get install -y procps

echo "Install NPM dependencies"
npm install total4 2>/dev/null
Expand Down

0 comments on commit 5e21741

Please sign in to comment.