This commit is contained in:
2017-09-06 18:25:17 +01:00
commit efb71c4e57
28 changed files with 6865 additions and 0 deletions

9
bin/mediakeys-play Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
status=$(cmus-remote -C status | grep ^status | awk '{print $2}')
if [ "$status" == "playing" ]; then
exec cmus-remote -u
else
exec cmus-remote -p
fi
exit 0

28
bin/vpn Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
OVPNURL=https://nordvpn.com/api/files/zip
OVPNPATH=/home/dan/.openvpn
OVPNAUTH=/home/dan/.nordvpnauth
PROTO=tcp
if [ "$1" == "--update" ] || [ "$1" == "-u" ]; then
echo "Updating..."
curl $OVPNURL > /tmp/nordvpn.zip
rm -f $OVPNPATH/*
unzip -qq /tmp/nordvpn.zip -d $OVPNPATH/
rm /tmp/nordvpn.zip
sed -i 's,auth-user-pass,auth-user-pass '"$OVPNAUTH"',g' $OVPNPATH/*
echo "Done."
exit 0
elif [ "$1" == "--kill" ] || [ "$1" == "-k" ]; then
sudo killall openvpn
else
find $OVPNPATH -name $1
find $OVPNPATH -name "*$1*$PROTO*" | sort -R | tail -1 | while read file; do
sudo killall openvpn
echo "Connecting to: $file"
sudo /usr/sbin/openvpn --config $file &
done
fi
exit 0