Repo: Added a update script.
This commit is contained in:
parent
92a93621d5
commit
a7725358f8
1 changed files with 20 additions and 0 deletions
20
update.sh
Normal file
20
update.sh
Normal 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
|
Loading…
Reference in a new issue