Storage memory usage: install + data directory: $INST
" else echo "Storage memory usage: install directory: $INST, data directory: $DAT
" fi elif [ $1 ]; then if [ -d $1 ]; then INST=`du -sh $1 | cut -f1` elif [ -f $1 ]; then INST=`ls -lah $1 | awk '{ print $5}'` fi echo "Storage memory usage: $INST
" fi } headphones_datacheck() { array=( ramfs proc tempfs sysfs ) fs=$( stat -f -c '%T' $DATADIR ) for i in "${array[@]}" do if [ $i = $fs ]; then echo "WARNING: Your Data Directory is not persistent and WILL NOT survive a reboot. Please locate Data Directory on disk for persistency
" break elif [ $i = msdos ]; then echo "WARNING: Your Data Directory is located on your flash drive. This will decrease your flash drives life span!
" break else echo "Your data will persist after a reboot
" break fi done } headphones_updateplg() { cd /boot/config/plugins if [ -f headphones_unplugged.64bit.plg ]; then [ -f headphones_unplugged.64bit.plg.old ] && rm -f headphones_unplugged.64bit.plg.old mv headphones_unplugged.64bit.plg headphones_unplugged.64bit.plg.old echo "Updating plugin" wget -q --no-check-certificate https://github.com/sacretagent/Unplugged_64Bit_Unraid.6/raw/master/headphones_unplugged.64bit.plg /usr/local/sbin/installplg /boot/config/plugins/headphones_unplugged.64bit.plg else echo "Updating plugin" wget -q --no-check-certificate https://github.com/sacretagent/Unplugged_64Bit_Unraid.6/raw/master/headphones_unplugged.64bit.plg /usr/local/sbin/installplg /boot/config/plugins/headphones_unplugged.64bit.plg fi } headphones_downgradeplg() { cd /boot/config/plugins if [ -f headphones_unplugged.64bit.plg.old ]; then rm -f /headphones_unplugged.64bit.plg mv headphones_unplugged.64bit.plg.old headphones_unplugged.64bit.plg echo "downgrading plugin" /usr/local/sbin/installplg /boot/config/plugins/headphones_unplugged.64bit.plg fi } headphones_vercheck() { cd $INSTALLDIR curversion=$( git rev-parse HEAD ) echo "$curversion" } # read our configuration source /boot/config/plugins/headphones/headphones.cfg case "$1" in 'start') headphones_start ;; 'stop') headphones_stop ;; 'restart') headphones_restart ;; 'enable') headphones_enable $2 $3 $4 $5 $6 $7 $8 ;; 'disable') headphones_disable $2 $3 $4 $5 $6 $7 $8 ;; 'install') headphones_install ;; 'update') headphones_update ;; 'storagesize') headphones_storagesize $2 $3 ;; 'datacheck') headphones_datacheck ;; 'updateplg') headphones_updateplg ;; 'downgradeplg') headphones_downgradeplg ;; 'buttonstart') headphones_buttonstart ;; 'vercheck') headphones_vercheck ;; *) echo "usage $0 start|stop|restart|enable|disable|install|update|datacheck|updateplg|downgradeplg" esac ]]>Headphones is installed with version: =$headphones_curversion;?>
if ($headphones_cfg[PLG_STORAGESIZE]=="yes"): ?> =$headphones_datasize?> endif; ?> if ($headphones_cfg[PLG_DATACHECK]=="yes"): ?> =$headphones_datacheck?> endif; ?>Plug-in Version: =$headphones_plgver;?>
if (strcmp($headphones_curversion, $headphones_newversion)!=0 && $headphones_curversion!="couldn't determine the Headphones version"): ?>