2022-03-15 08:25:40 -04:00
|
|
|
#!/usr/bin/env bash
|
2022-03-16 17:42:54 -04:00
|
|
|
clear
|
|
|
|
YW=`echo "\033[33m"`
|
2022-03-15 08:25:40 -04:00
|
|
|
BL=`echo "\033[36m"`
|
2022-03-16 17:42:54 -04:00
|
|
|
RD=`echo "\033[01;31m"`
|
2022-03-15 08:25:40 -04:00
|
|
|
CM='\xE2\x9C\x94\033'
|
|
|
|
GN=`echo "\033[1;92m"`
|
|
|
|
CL=`echo "\033[m"`
|
2022-03-16 17:42:54 -04:00
|
|
|
while true; do
|
|
|
|
read -p "This will Update Dashy LXC. Proceed(y/n)?" yn
|
|
|
|
case $yn in
|
|
|
|
[Yy]* ) break;;
|
|
|
|
[Nn]* ) exit;;
|
|
|
|
* ) echo "Please answer yes or no.";;
|
|
|
|
esac
|
|
|
|
done
|
2022-03-15 08:25:40 -04:00
|
|
|
clear
|
2022-03-16 17:42:54 -04:00
|
|
|
function header_info {
|
|
|
|
echo -e "${RD}
|
|
|
|
_____ _
|
|
|
|
| __ \ | |
|
|
|
|
| | | | __ _ ___| |__ _ _
|
|
|
|
| | | |/ _ / __| _ \| | | |
|
|
|
|
| |__| | (_| \__ \ | | | |_| |
|
|
|
|
|_____/ \__,_|___/_| |_|\__, |
|
|
|
|
UPDATE __/ |
|
|
|
|
|___/
|
|
|
|
${CL}"
|
|
|
|
}
|
|
|
|
|
|
|
|
header_info
|
2022-03-15 08:25:40 -04:00
|
|
|
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"
|
|
|
|
|
2022-03-15 09:12:17 -04:00
|
|
|
echo -en "${GN} Backup conf.yml... "
|
|
|
|
cp -R /dashy/public/conf.yml conf.yml
|
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-16 18:08:45 -04:00
|
|
|
git merge &>/dev/null
|
2022-03-15 08:48:20 -04:00
|
|
|
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"
|
|
|
|
|
2022-03-15 09:12:17 -04:00
|
|
|
echo -en "${GN} Restoring conf.yml... "
|
2022-03-15 08:48:20 -04:00
|
|
|
cd ~
|
2022-03-15 09:12:17 -04:00
|
|
|
cp -R conf.yml /dashy/public
|
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} Cleaning... "
|
2022-03-15 09:12:17 -04:00
|
|
|
rm -rf conf.yml
|
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"
|