http://slackware.cs.utah.edu/pub/slackware/slackware64-14.1/slackware64/d/python-2.7.5-x86_64-1.txz 9b37a33a41b263c945fddb58949386f0 http://slackware.cs.utah.edu/pub/slackware/slackware64-14.1/slackware64/ap/sqlite-3.7.17-x86_64-1.txz 730417ec4d8158c6bb5862417107b9f4 http://slackware.cs.utah.edu/pub/slackware/slackware64-14.1/slackware64/d/git-1.8.4-x86_64-1.txz e24d44ec30e7afc16c5509c4d9446140 --no-check-certificate https://github.com/downloads/Influencer/UNplugged/device_status.png --no-check-certificate https://github.com/downloads/Influencer/UNplugged/new_config.png --no-check-certificate https://github.com/downloads/Influencer/UNplugged/information.png --no-check-certificate https://raw.github.com/rembo10/headphones/master/data/images/headphoneslogo.png /boot/config/plugins/headphones/headphones.cfg echo "SERVICE=\"$SERVICE\"" >> /boot/config/plugins/headphones/headphones.cfg echo "INSTALLDIR=\"$INSTALLDIR\"" >> /boot/config/plugins/headphones/headphones.cfg echo "DATADIR=\"$DATADIR\"" >> /boot/config/plugins/headphones/headphones.cfg echo "PORT=\"$PORT\"" >> /boot/config/plugins/headphones/headphones.cfg echo "RUNAS=\"$RUNAS\"" >> /boot/config/plugins/headphones/headphones.cfg echo "PLG_STORAGESIZE=\"$PLG_STORAGESIZE\"" >> /boot/config/plugins/headphones/headphones.cfg echo "PLG_DATACHECK=\"$PLG_DATACHECK\"" >> /boot/config/plugins/headphones/headphones.cfg } headphones_change_settings() { PORT="$2" INSTALLDIR="$3" DATADIR="$4" if [ $DATADIR == "" ]; then $DATADIR="$INSTALLDIR" fi if [ $RUNAS != $1 ]; then chown -R $1:users "$INSTALLDIR" "$DATADIR" fi RUNAS="$1" PLG_STORAGESIZE="$5" PLG_DATACHECK="$6" # create Headphones user if necessary if [[ $RUNAS != "nobody" && $RUNAS != "root" ]]; then if ( ! grep -q ^$RUNAS /etc/passwd ); then useradd -r -g users -d / -s /bin/false $RUNAS &> /dev/null cp /etc/passwd /etc/shadow /boot/config fi fi } headphones_enable() { # if not already enabled, enable it SERVICE=enable headphones_stop headphones_change_settings $1 $2 $3 $4 $5 $6 $7 $8 write_config headphones_start } headphones_disable() { headphones_stop SERVICE=disable headphones_change_settings $1 $2 $3 $4 $5 $6 $7 $8 write_config } headphones_install() { echo "installing latest Version of headphones" if [ ! -e "$INSTALLDIR" ]; then mkdir -p $INSTALLDIR fi if [ ! -e "$DATADIR" ]; then mkdir -p $DATADIR fi if [ -e ""$DATADIR"/version.txt" ]; then rm ""$DATADIR"/version.txt" fi cd /tmp git clone -b master https://github.com/rembo10/headphones headphones cp -Rfu /tmp/headphones/* $INSTALLDIR rm -Rf /tmp/headphones } headphones_storagesize() { if [ $1 ] && [ $2 ]; then if [ -d $1 ]; then INST=`du -sh $1 | cut -f1` elif [ -f $1 ]; then INST=`ls -lah $1 | awk '{ print $5}'` fi if [ -d $2 ]; then DAT=`du -sh $2 | cut -f1` elif [ -f $2 ]; then DAT=`ls -lah $2 | awk '{ print $5}'` fi if [ $1 == $2 ]; then echo "

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 ]]>
/boot/config/plugins/headphones/headphones.png /boot/config/plugins/images/device_status.png /boot/config/plugins/images/new_config.png /boot/config/plugins/images/information.png
Status: RUNNING with version: STOPPED NOT INSTALLED


Headphones is installed with version:

Plug-in Version:

Update available to version:


Configuration:
Enable HeadPhones:
Install directory:
Data directory: onChange="checkDATADIR(this.form);">
Port:
Run as user:
---
Show storage memory usage:
Show data persistency information:


]]>