Update update.sh
parent
db30db9705
commit
e314dda90d
23
Update.sh
23
Update.sh
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# Update PoshC2
|
||||
echo ""
|
||||
|
@ -15,19 +15,26 @@ echo ""
|
|||
echo "[+] Updating PoshC2_Python"
|
||||
echo ""
|
||||
|
||||
ROOTDIR=`dirname "$0"`
|
||||
if [ ! -d "$ROOTDIR" ]; then
|
||||
ROOTDIR="/opt/PoshC2_Python/"
|
||||
fi
|
||||
pushd "$ROOTDIR" > /dev/null
|
||||
|
||||
# Backup config
|
||||
echo "[+] Backup Config.py"
|
||||
mv /opt/PoshC2_Python/Config.py /tmp/Config.py
|
||||
echo "[+] Backup Config"
|
||||
git stash > /dev/null
|
||||
|
||||
# Install requirements for PoshC2_Python
|
||||
echo ""
|
||||
echo "[+] Performing git pull on /opt/PoshC2_Python/"
|
||||
cd /opt/PoshC2_Python/
|
||||
git pull
|
||||
echo "[+] Performing git pull on $ROOTDIR"
|
||||
git pull
|
||||
|
||||
# Restore config
|
||||
echo "[+] Restore Config.py"
|
||||
mv /tmp/Config.py /opt/PoshC2_Python/Config.py
|
||||
echo "[+] Restore Config"
|
||||
git stash pop > /dev/null
|
||||
echo ""
|
||||
echo "[+] Update complete"
|
||||
echo ""
|
||||
|
||||
popd > /dev/null
|
||||
|
|
Loading…
Reference in New Issue