diff --git a/ipinfo/ipinfo b/ipinfo/ipinfo new file mode 100755 index 0000000..ade12bf --- /dev/null +++ b/ipinfo/ipinfo @@ -0,0 +1,12 @@ +#!/bin/sh + +curl_ret=$(curl -s https://ipinfo.io) +awk_state="/\"$1\"/ {print \$2}" +#echo "CR: $curl_ret" +#echo "AS: $awk_state" + +if [ "$1" == "" ]; then + echo "$curl_ret" +else + echo "$curl_ret"| awk "$awk_state"| tr -d [\",] +fi diff --git a/jweb/jweb b/jweb/jweb new file mode 100755 index 0000000..74ff349 --- /dev/null +++ b/jweb/jweb @@ -0,0 +1,2 @@ +#!/bin/sh +bundle exec jekyll server -w diff --git a/sw-vpn/sw-vpn b/sw-vpn/sw-vpn new file mode 100755 index 0000000..fcafd5b --- /dev/null +++ b/sw-vpn/sw-vpn @@ -0,0 +1,20 @@ +#!/bin/sh +curr_vpn="$(systemctl list-units | tr -d '*' | awk '/openvpn-client/ {print $1}')" + +if [ "" = "$curr_vpn" ]; then + echo "No running VPN. Will start one." +else + echo "Current VPN: $curr_vpn" + echo "systemctl stop $curr_vpn" + systemctl stop $curr_vpn + echo "Stopped $curr_vpn" +fi + +if [ "" = "$1" ]; then + echo "No VPN specified to start. Pass as first argument." +else + echo "Starting openvpn-client@$1" + echo "systemctl start openvpn-client@$1" + systemctl start "openvpn-client@$1" + echo "Started openvpn-client@$1" +fi