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

18 lines
420 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
2022-05-27 14:09:40 -04:00
source /etc/glacier/hooks.sh
2022-05-02 12:43:14 -04:00
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-05-03 17:25:04 -04:00
cd /var/cache/glacier && rm *
2022-04-20 15:40:25 -04:00
printf "\033[1;32m [ $check ] \033[m Cache cleared."