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/l/libffi-3.0.13-x86_64-2.txz ffb02e5decdc081bf5f0846bcf0ac6b6 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/W-W/unRAID/couchpotato_v2.png --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 > /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "INSTALLURL=\"https://github.com/RuudBurger/CouchPotatoServer\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "BRANCH=\"master\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg fi plgstorage=`cat /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg | grep PLG_STORAGESIZE` if [[ $plgstorage = "" ]]; then echo "PLG_STORAGESIZE=\"yes\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg fi plgdata=`cat /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg | grep PLG_DATACHECK` if [[ $plgdata = "" ]]; then echo "PLG_DATACHECK=\"yes\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg fi rm /tmp/checkconfig ]]> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "SERVICE=\"$SERVICE\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "INSTALLDIR=\"$INSTALLDIR\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "CONFIGFILE=\"$CONFIGFILE\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "RUNAS=\"$RUNAS\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "PLG_STORAGESIZE=\"$PLG_STORAGESIZE\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "PLG_DATACHECK=\"$PLG_DATACHECK\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "INSTALLURL=\"$INSTALLURL\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "BRANCH=\"$BRANCH\"" >> /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg if [ -e "$CONFIGFILE" ]; then sed -i 's!data_dir = '"`cat "$CONFIGFILE" | grep 'data_dir' | cut -d' ' -f3`"'!data_dir = '"$DATADIR"'!' "$CONFIGFILE" sed -i 's!port = '"`cat "$CONFIGFILE" | grep 'port = ' | cut -d' ' -f3 | awk 'NR==2'`"'!port = '"$PORT"'!' "$CONFIGFILE" fi } couchpotato_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" INSTALLURL="$7" BRANCH="$8" # create CouchPotato v2 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 } couchpotato_enable() { # if not already enabled, enable it SERVICE=enable if [ $PORT != $2 ];then couchpotato_change_settings $1 $2 $3 $4 $5 $6 $7 $8 write_config couchpotato_restart else couchpotato_change_settings $1 $2 $3 $4 $5 $6 $7 $8 write_config fi # enabling also starts it if [ ! -f /var/run/couchpotato_v2/couchpotato_v2.pid ]; then couchpotato_start fi } couchpotato_disable() { couchpotato_stop SERVICE=disable couchpotato_change_settings $1 $2 $3 $4 $5 $6 $7 $8 write_config } couchpotato_install() { source /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg echo "Installing latest version of CouchPotato v2..." if [ ! -e "$INSTALLDIR" ]; then mkdir -p $INSTALLDIR fi DATADIR="`cat "$CONFIGFILE" | grep 'data_dir' | cut -d' ' -f3`" if [ ! -e "$DATADIR" ]; then mkdir -p $DATADIR fi if [ -e ""$DATADIR"/cache/version" ]; then rm ""$DATADIR"/cache/version" fi cd /tmp git clone -b $BRANCH $INSTALLURL Couchpotato cp -Rfu /tmp/Couchpotato/. $INSTALLDIR rm -Rf /tmp/Couchpotato chown -R $RUNAS:users "$INSTALLDIR" "$DATADIR" sleep 1 echo "... OK" sleep 1 } couchpotato_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 } couchpotato_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 } couchpotato_updateplg() { cd /boot/config/plugins [ -f couchpotato_v2_unplugged.64bit.plg.old ] && rm -f couchpotato_v2_unplugged.64bit.plg.old if [ -f couchpotato_v2_unplugged.64bit.plg ]; then mv couchpotato_v2_unplugged.64bit.plg couchpotato_v2_unplugged.64bit.plg.old echo "Updating plugin" wget -q --no-check-certificate https://github.com/sacretagent/Unplugged_64Bit_Unraid.6/raw/master/couchpotato_v2_unplugged.64bit.plg /usr/local/sbin/installplg /boot/config/plugins/couchpotato_v2_unplugged.64bit.plg else echo "Updating plugin" wget -q --no-check-certificate https://github.com/sacretagent/Unplugged_64Bit_Unraid.6/raw/master/couchpotato_v2_unplugged.64bit.plg /usr/local/sbin/installplg /boot/config/plugins/couchpotato_v2_unplugged.64bit.plg fi } couchpotato_downgradeplg() { cd /boot/config/plugins if [ -f couchpotato_v2_unplugged.64bit.plg.old ]; then rm -f couchpotato_v2_unplugged.64bit.plg mv couchpotato_v2_unplugged.64bit.plg.old couchpotato_v2_unplugged.64bit.plg echo "downgrading plugin" /usr/local/sbin/installplg /boot/config/plugins/couchpotato_v2_unplugged.64bit.plg fi } couchpotato_vercheck() { set -x if [ -e $DATADIR/cache/version ]; then curversion=$( cat $DATADIR/cache/version ) echo "$curversion" fi } # read our configuration source /boot/config/plugins/couchpotato_v2/couchpotato_v2.cfg if [ -e "$CONFIGFILE" ]; then DATADIR=`cat "$CONFIGFILE" | grep 'data_dir' | cut -d' ' -f3` PORT=`cat "$CONFIGFILE" | grep 'port = ' | cut -d' ' -f3 | awk 'NR==2'` fi case "$1" in 'start') couchpotato_start ;; 'stop') couchpotato_stop ;; 'restart') couchpotato_restart ;; 'enable') couchpotato_enable $2 $3 $4 $5 $6 $7 $8 $9 ;; 'disable') couchpotato_disable $2 $3 $4 $5 $6 $7 $8 $9 ;; 'install') couchpotato_install ;; # 'update') # couchpotato_update # ;; 'storagesize') couchpotato_storagesize $2 $3 ;; 'datacheck') couchpotato_datacheck ;; 'updateplg') couchpotato_updateplg ;; 'downgradeplg') couchpotato_downgradeplg ;; 'buttonstart') couchpotato_buttonstart ;; # 'vercheck') # couchpotato_vercheck # ;; *) echo "usage $0 start|stop|restart|enable|disable|install|update|storagesize|datacheck|updateplg|downgradeplg" esac ]]>
/boot/config/plugins/couchpotato_v2/couchpotato_v2.png /boot/config/plugins/images/device_status.png /boot/config/plugins/images/new_config.png /boot/config/plugins/images/information.png
Status: RUNNING STOPPED NOT INSTALLED


Installed from branch of site

Plug-in Version:

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


Install from:
Specify branch:

]]>