--no-check-certificate https://dl.dumptruck.goldenfrog.com/p/Vq3zpArAKB/python-2.7.3-i686-5PTr.txz?dl=1 644b5f3f14e76aaa5b43f01a50d8defa http://slackware.cs.utah.edu/pub/slackware/slackware-13.37/slackware/ap/screen-4.0.3-i486-1.txz 1a59b0fdac921b858510d57e43f77543 http://slackware.cs.utah.edu/pub/slackware/slackware-13.37/slackware/a/utempter-1.1.5-i486-1.txz efa4d897211fd5c3f3a027425d8126f8 http://slackware.cs.utah.edu/pub/slackware/slackware-13.37/slackware/l/zlib-1.2.5-i486-4.txz eabaa7087a32dfd9f6d2662163779d07 --no-check-certificate https://dl.dumptruck.goldenfrog.com/p/Vq3zpArAKB/libidn-1.26-i686-1PTr.txz?dl=1 4b0b70c9f32d91d84a88270dc499844a http://slackware.osuosl.org/slackware-13.37/slackware/d/git-1.7.4.4-i486-1.txz 5d92bd44e67618dfdacc2e2fa9a41821 --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://dl.dropboxusercontent.com/u/29067424/plexconnect.png /var/run/PlexConnect/PlexConnect-$PORT.pid echo -n "Starting PlexConnect: $CMDLINE" $CMDLINE echo while [ ! -e /var/run/PlexConnect/PlexConnect-$PORT.pid ]; do sleep 1 done echo "... OK" sleep 1 } PlexConnect_stop() { # no-op if not running if [ ! -r /var/run/PlexConnect/PlexConnect-$PORT.pid ]; then return fi echo "Stopping PlexConnect..." sleep 1 kill $(cat /var/run/PlexConnect/PlexConnect-$PORT.pid) sleep 3 if [ -f /var/run/PlexConnect/PlexConnect-$PORT.pid ]; then rm /var/run/PlexConnect/PlexConnect-$PORT.pid fi while [ -e /var/run/PlexConnect/PlexConnect-$PORT.pid ]; do sleep 1 done echo "... OK" sleep 1 } PlexConnect_restart() { PlexConnect_stop sleep 1 PlexConnect_start } PlexConnect_buttonstart() { echo "Enabling PlexConnect" CONFIG="/boot/config/plugins/PlexConnect/PlexConnect.cfg" if [ -f $CONFIG ]; then sed -i "s/"disable"/"enable/"" $CONFIG sleep 3 echo "Starting PlexConnect" PlexConnect_start fi } PlexConnect_update() { PlexConnect_stop sleep 1 echo "installing latest Version of PlexConnect" if [ -e ""$DATADIR"/version.txt" ]; then rm ""$DATADIR"/version.txt" fi cd /tmp git clone https://github.com/iBaa/PlexConnect.git cp -Rfu /tmp/PlexConnect/. $INSTALLDIR rm -Rf /tmp/PlexConnect chown -R $RUNAS:users "$INSTALLDIR" "$DATADIR" sleep 1 PlexConnect_start } write_config() { echo "# PlexConnect configuration" > /boot/config/plugins/PlexConnect/PlexConnect.cfg echo "SERVICE=\"$SERVICE\"" >> /boot/config/plugins/PlexConnect/PlexConnect.cfg echo "INSTALLDIR=\"$INSTALLDIR\"" >> /boot/config/plugins/PlexConnect/PlexConnect.cfg echo "DATADIR=\"$DATADIR\"" >> /boot/config/plugins/PlexConnect/PlexConnect.cfg echo "PORT=\"$PORT\"" >> /boot/config/plugins/PlexConnect/PlexConnect.cfg echo "RUNAS=\"$RUNAS\"" >> /boot/config/plugins/PlexConnect/PlexConnect.cfg echo "PLG_STORAGESIZE=\"$PLG_STORAGESIZE\"" >> /boot/config/plugins/PlexConnect/PlexConnect.cfg echo "PLG_DATACHECK=\"$PLG_DATACHECK\"" >> /boot/config/plugins/PlexConnect/PlexConnect.cfg } PlexConnect_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 PlexConnect 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 } PlexConnect_enable() { # if not already enabled, enable it SERVICE=enable PlexConnect_stop PlexConnect_change_settings $1 $2 $3 $4 $5 $6 $7 $8 write_config PlexConnect_start } PlexConnect_disable() { PlexConnect_stop SERVICE=disable PlexConnect_change_settings $1 $2 $3 $4 $5 $6 $7 $8 write_config } PlexConnect_install() { echo "installing latest Version of PlexConnect" 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 https://github.com/iBaa/PlexConnect.git cp -Rfu /tmp/PlexConnect/* $INSTALLDIR rm -Rf /tmp/PlexConnect } PlexConnect_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 } PlexConnect_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 } PlexConnect_updateplg() { cd /boot/config/plugins if [ -f Plexconnect_V3_with_Cert.plg ]; then [ -f Plexconnect_V3_with_Cert.plg.old ] && rm -f Plexconnect_V3_with_Cert.plg.old mv Plexconnect_V3_with_Cert.plg Plexconnect_V3_with_Cert.plg.old echo "Updating plugin" wget -q --no-check-certificate https://raw.github.com/sacretagent/UNplugged/master/Plexconnect_V3_with_Cert.plg /usr/local/sbin/installplg /boot/config/plugins/Plexconnect_V3_with_Cert.plg else echo "Updating plugin" wget -q --no-check-certificate https://raw.github.com/sacretagent/UNplugged/master/Plexconnect_V3_with_Cert.plg /usr/local/sbin/installplg /boot/config/plugins/Plexconnect_V3_with_Cert.plg fi } PlexConnect_downgradeplg() { cd /boot/config/plugins if [ -f Plexconnect_V3_with_Cert.plg.old ]; then rm -f /Plexconnect_V3_with_Cert.plg mv Plexconnect_V3_with_Cert.plg.old Plexconnect_V3_with_Cert.plg echo "downgrading plugin" /usr/local/sbin/installplg /boot/config/plugins/Plexconnect_V3_with_Cert.plg fi } PlexConnect_vercheck() { cd $INSTALLDIR curversion=$( git rev-parse HEAD ) echo "$curversion" } # read our configuration source /boot/config/plugins/PlexConnect/PlexConnect.cfg case "$1" in 'start') PlexConnect_start ;; 'stop') PlexConnect_stop ;; 'restart') PlexConnect_restart ;; 'enable') PlexConnect_enable $2 $3 $4 $5 $6 $7 $8 ;; 'disable') PlexConnect_disable $2 $3 $4 $5 $6 $7 $8 ;; 'install') PlexConnect_install ;; 'update') PlexConnect_update ;; 'storagesize') PlexConnect_storagesize $2 $3 ;; 'datacheck') PlexConnect_datacheck ;; 'updateplg') PlexConnect_updateplg ;; 'downgradeplg') PlexConnect_downgradeplg ;; 'buttonstart') PlexConnect_buttonstart ;; 'vercheck') PlexConnect_vercheck ;; *) echo "usage $0 start|stop|restart|enable|disable|install|update|datacheck|updateplg|downgradeplg" esac ]]>
/boot/config/plugins/PlexConnect/plexconnect.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


PlexConnect is installed with version:

Plug-in Version:

Update available to version:


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


]]>