From 00b65abd09cd3eade45475e4138574554b725221 Mon Sep 17 00:00:00 2001 From: nate Date: Mon, 28 Mar 2016 18:44:54 -0500 Subject: [PATCH] Minor changes to reflect new tool usage Removed symlink of scripts to u/l/b Added copy for setupLCD to /opt/pihole/ New spinner added to gravity.sh to reflect new spinner in basic-install.sh and uninstall.sh --- automated install/basic-install.sh | 11 ++++------- automated install/uninstall.sh | 8 -------- gravity.sh | 25 +++++++++++++------------ 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index dd5aa3a1..3597f757 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -93,8 +93,8 @@ backupLegacyPihole() { if [ ! -d /opt/pihole ]; then $SUDO mkdir /opt/pihole $SUDO chown "$USER":root /opt/pihole - $SUDO chmod 1766 /opt/pihole - fi + $SUDO chmod u+srwx /opt/pihole + fi $SUDO mv /opt/pihole/gravity.sh /etc/pihole/original/gravity.sh."$(date "+%Y-%m-%d")" else : @@ -481,11 +481,8 @@ installScripts() { $SUDO cp /etc/.pihole/advanced/Scripts/piholeLogFlush.sh /opt/pihole/piholeLogFlush.sh $SUDO cp /etc/.pihole/advanced/Scripts/updateDashboard.sh /opt/pihole/updateDashboard.sh $SUDO cp /etc/.pihole/automated\ install/uninstall.sh /opt/pihole/uninstall.sh - $SUDO chmod 755 /opt/pihole/{gravity,chronometer,whitelist,blacklist,piholeLogFlush,updateDashboard,uninstall}.sh - for f in /opt/pihole/*; do - filename=${f##*/} - $SUDO ln -s /opt/pihole/"$filename" /usr/local/bin/"$filename" - done + $SUDO cp /etc/.pihole/advanced/Scripts/setupLCD.sh /opt/pihole/setupLCD.sh + $SUDO chmod 755 /opt/pihole/{gravity,chronometer,whitelist,blacklist,piholeLogFlush,updateDashboard,uninstall,setupLCD}.sh $SUDO echo " done." } diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 786e8cea..0ac06521 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -114,14 +114,6 @@ function removeNoPurge { $SUDO mv /etc/lighttpd/lighttpd.conf.orig /etc/lighttpd/lighttpd.conf fi fi - $SUDO rm /usr/local/bin/gravity.sh &> /dev/null - $SUDO rm /usr/local/bin/chronometer.sh &> /dev/null - $SUDO rm /usr/local/bin/whitelist.sh &> /dev/null - $SUDO rm /usr/local/bin/blacklist.sh &> /dev/null - $SUDO rm /usr/local/bin/piholeLogFlush.sh &> /dev/null - $SUDO rm /usr/local/bin/piholeDebug.sh &> /dev/null - $SUDO rm /usr/local/bin/updateDashboard.sh &> /dev/null - $SUDO rm /usr/local/bin/uninstall.sh &> /dev/null $SUDO rm /etc/dnsmasq.d/adList.conf &> /dev/null $SUDO rm -rf /var/log/*pihole* &> /dev/null $SUDO rm -rf /etc/pihole/ &> /dev/null diff --git a/gravity.sh b/gravity.sh index 531ae4c1..c7b60680 100755 --- a/gravity.sh +++ b/gravity.sh @@ -75,18 +75,19 @@ if [[ -r $piholeDir/pihole.conf ]];then fi -spinner(){ - local pid=$1 - - spin='-\|/' - i=0 - while $SUDO kill -0 "$pid" 2>/dev/null - do - i=$(( (i+1) %4 )) - printf "\b%s" "${spin:$i:1}" - sleep .1 - done - printf "\b" +spinner() +{ + local pid=$1 + local delay=0.50 + local spinstr='|/-\' + while [ "$(ps a | awk '{print $1}' | grep "$pid")" ]; do + local temp=${spinstr#?} + printf " [%c] " "$spinstr" + local spinstr=$temp${spinstr%"$temp"} + sleep $delay + printf "\b\b\b\b\b\b" + done + printf " \b\b\b\b" } ###########################