20 lines
501 B
Bash
20 lines
501 B
Bash
|
#!/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
|