Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Bash by ghghghgh ( 8 years ago )
#!/bin/sh
   APP='/usr/bin/firefox.bin'
#script to run $APP as spot...
while [ -z "`ip a|grep eth0|awk '/inet/{print $2}'|sed -e 's/\/.*$//'`"]; do
    sleep 5
done
ARGS="http://tools.lo.iv.lt/status/monitors/`ip a|grep eth0|awk '/inet/{print $2}'|sed -e 's/\\\\\\\\/.*$//'`/"
[ "$1" ] && while [ "$1" ]; do ARGS="$ARGS \\\\\\\\"$1\""; shift; done
if [ $(id -u) -eq 0 ]; then
 [ $XAUTHORITY ] && cp $XAUTHORITY /root/spot/.Xauthority 2>/dev/null
 touch /root/spot/.Xauthority
 #following line is mostly there to catch any root:root files that may have got copied in...
 chown -R spot:spot /root/spot &
 export XAUTHORITY=/root/spot/.Xauthority  
 export XDG_CONFIG_HOME=/root/spot/.config
 export XDG_CACHE_HOME=/root/spot/.cache
 export XDG_DATA_HOME=/root/spot/.local/share
 exec su spot -s /bin/sh -c "\"$APP\" $ARGS"
else #precaution
 exec "$APP" "$ARGS"
fi

 

Revise this Paste

Your Name: Code Language: