Repo: Added a update script.

This commit is contained in:
Sugaryy_ 2023-05-27 15:17:49 +02:00
parent 92a93621d5
commit a7725358f8

20
update.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/bash
# A script for updating the root website
# Made by sugary :3
WEBSITES_PATH="/var/www/"
WEBSITE_NAME="root"
as_root()
{
if [ $EUID = 0 ]; then $*
elif [ -x /usr/bin/sudo ]; then sudo $*
else su -c \\"$*\\"
fi
}
export -f as_root
as_root cp -rf $WEBSITES_PATH/$WEBSITE_NAME $WEBSITES_PATH/$WEBSITE_NAME.bak
as_root rm -rf $WEBSITES_PATH/$WEBSITE_NAME
as_root mkdir $WEBSITES_PATH/$WEBSITE_NAME
as_root cp -rf src/* $WEBSITES_PATH/$WEBSITE_NAME