ProxmoxVE-HelperScripts/misc/dashy-update.sh

44 lines
816 B
Bash
Raw Normal View History

2022-03-15 08:25:40 -04: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 08:48:20 -04:00
sleep 1
2022-03-15 08:25:40 -04:00
echo -e "${CM}${CL} \r"
echo -en "${GN} Backup Data... "
cp -R /dashy/public public-backup
2022-03-15 08:48:20 -04:00
sleep 1
2022-03-15 08:25:40 -04:00
echo -e "${CM}${CL} \r"
echo -en "${GN} Updating Dashy... "
2022-03-15 08:29:46 -04:00
cd /dashy
2022-03-15 08:48:20 -04:00
git merge &>/dev/null
git pull origin master &>/dev/null
yarn &>/dev/null
yarn build &>/dev/null
2022-03-15 08:25:40 -04:00
echo -e "${CM}${CL} \r"
echo -en "${GN} Restoring Data... "
2022-03-15 08:48:20 -04:00
cd ~
cp -R public-backup /dashy/public
sleep 1
2022-03-15 08:25:40 -04:00
echo -e "${CM}${CL} \r"
echo -en "${GN} Cleaning... "
rm -rf public-backup
2022-03-15 08:48:20 -04:00
sleep 1
2022-03-15 08:25:40 -04:00
echo -e "${CM}${CL} \r"
echo -en "${GN} Starting Dashy... "
systemctl start dashy
2022-03-15 08:48:20 -04:00
sleep 1
2022-03-15 08:25:40 -04:00
echo -e "${CM}${CL} \r"
echo -e "${GN} Finished ${CL}\n"