Files
mediamanager/defaults.inc
2023-03-01 22:04:05 -06:00

55 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
VERS='2.02252023'
MMFOLDER="/opt/idssys/mediamanager"
MMSRV=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
noheader=' check noup stop '
declare -A NM_SERVICES
NM_SERVICES['nordvpn']='NordVPN (VPN Tunnel)'
NM_SERVICES['openvpn']='OpenVPN (TorGuard VPN Tunnel)'
NM_SERVICES['wireguard']='WireGuard (TorGuard VPN Tunnel)'
NM_SERVICES['lidarr']='Lidarr (Music Manager)'
NM_SERVICES['radarr']='Radarr (Movie Manager)'
NM_SERVICES['radarr3d']='Radarr3D (3D Movie Manager)'
NM_SERVICES['sonarr']='Sonarr (TV Show Manager)'
NM_SERVICES['bazarr']='Bazarr (Subtitle Manager)'
NM_SERVICES['jackett']='Jackett (Torrent Indexing Manager)'
NM_SERVICES['qbittorrent']='qBittorrent (Torrent Downloader)'
NM_SERVICES['snap.tautulli.tautulli']='Tautulli (Plex Stats)'
NM_SERVICES['ombi']='Ombi (Download Requester)'
#if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"10.10.1.24"* ]]; then
if [ "${VPN_INTERFACE}" = "nordlynx" ]; then
# VPN_START=(/usr/bin/nordvpn connect United_States Chicago)
# VPN_START=(/usr/bin/nordvpn connect us9316)
VPN_START=(/usr/bin/nordvpn c double_vpn)
VPN_STOP=(/usr/bin/nordvpn disconnect)
else
#VPN_START=(/bin/systemctl start openvpn)
#VPN_STOP=(/bin/systemctl stop openvpn)
VPN_START=(/usr/bin/wg-quick up wg-torguard)
VPN_STOP=(/usr/bin/wg-quick down wg-torguard)
fi
DEBUGLOGSTOP(){
chktmend=`date +%s`
chktm=$((chktmend-chktmstart))
echo "$(date) - ${mmsv} Runtime: ${chktm}s" >> $logfile
}
MMUPDATECHECK(){
if curl -m 15 -s --head --request GET https://git.schroedercity.com | grep "HTTP/2 200" > /dev/null; then
cd ${MMFOLDER}
if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/master |cut -f1`" ]; then
touch ${MMFOLDER}/update.available
fi
else
/bin/rm -f ${MMFOLDER}/update.available
fi
}