2022-03-15 14:25:40 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
RD=`echo "\033[01;31m"`
|
|
|
|
BL=`echo "\033[36m"`
|
|
|
|
CM='\xE2\x9C\x94\033'
|
|
|
|
GN=`echo "\033[1;92m"`
|
|
|
|
CL=`echo "\033[m"`
|
|
|
|
clear
|
|
|
|
echo -en "${GN} Stopping Dashy... "
|
|
|
|
systemctl stop dashy
|
2022-03-15 14:48:20 +02:00
|
|
|
sleep 1
|
2022-03-15 14:25:40 +02:00
|
|
|
echo -e "${CM}${CL} \r"
|
|
|
|
|
2022-03-15 15:12:17 +02:00
|
|
|
echo -en "${GN} Backup conf.yml... "
|
|
|
|
cp -R /dashy/public/conf.yml conf.yml
|
2022-03-15 14:48:20 +02:00
|
|
|
sleep 1
|
2022-03-15 14:25:40 +02:00
|
|
|
echo -e "${CM}${CL} \r"
|
|
|
|
|
|
|
|
echo -en "${GN} Updating Dashy... "
|
2022-03-15 14:29:46 +02:00
|
|
|
cd /dashy
|
2022-03-16 02:57:48 +02:00
|
|
|
git stash &>/dev/null
|
2022-03-15 14:48:20 +02:00
|
|
|
git pull origin master &>/dev/null
|
|
|
|
yarn &>/dev/null
|
|
|
|
yarn build &>/dev/null
|
2022-03-15 14:25:40 +02:00
|
|
|
echo -e "${CM}${CL} \r"
|
|
|
|
|
2022-03-15 15:12:17 +02:00
|
|
|
echo -en "${GN} Restoring conf.yml... "
|
2022-03-15 14:48:20 +02:00
|
|
|
cd ~
|
2022-03-15 15:12:17 +02:00
|
|
|
cp -R conf.yml /dashy/public
|
2022-03-15 14:48:20 +02:00
|
|
|
sleep 1
|
2022-03-15 14:25:40 +02:00
|
|
|
echo -e "${CM}${CL} \r"
|
|
|
|
|
|
|
|
echo -en "${GN} Cleaning... "
|
2022-03-15 15:12:17 +02:00
|
|
|
rm -rf conf.yml
|
2022-03-15 14:48:20 +02:00
|
|
|
sleep 1
|
2022-03-15 14:25:40 +02:00
|
|
|
echo -e "${CM}${CL} \r"
|
|
|
|
|
|
|
|
echo -en "${GN} Starting Dashy... "
|
|
|
|
systemctl start dashy
|
2022-03-15 14:48:20 +02:00
|
|
|
sleep 1
|
2022-03-15 14:25:40 +02:00
|
|
|
echo -e "${CM}${CL} \r"
|
|
|
|
|
|
|
|
echo -e "${GN} Finished ${CL}\n"
|