glacier-old/scripts/glacier-cache-clear.sh

18 lines
423 B
Bash
Raw Normal View History

2022-04-12 12:38:01 -04:00
#!/bin/sh
# glacier-cache-clear
# Script used to clear Glacier's cache
2022-05-02 12:43:14 -04:00
# Glacier preloading
source /etc/glacier.conf
2022-04-12 12:38:01 -04:00
# Require the script to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
2022-04-20 15:40:25 -04:00
printf "\033[1;31m [ $error ] \033[m Please run Glacier as root."
2022-04-12 12:38:01 -04:00
exit
fi
2022-04-20 15:40:25 -04:00
printf "\033[1;34m [ i ] \033[m Clearing cache... "
2022-04-12 12:38:01 -04:00
cd /var/cache/glacier && rm *.tar.gz
2022-04-20 15:40:25 -04:00
printf "\033[1;32m [ $check ] \033[m Cache cleared."