Private GIT

Skip to content
Snippets Groups Projects
Unverified Commit a68c12bd authored by miigotu's avatar miigotu
Browse files

Pycharm code inspection on install script

parent c32c66b8
Branches
No related tags found
No related merge requests found
...@@ -19,8 +19,8 @@ fi ...@@ -19,8 +19,8 @@ fi
# Get external ip address (checking 3 sites for redundancy) # Get external ip address (checking 3 sites for redundancy)
for i in 'ipecho.net/plain' 'ifconfig.me' 'checkip.amazonaws.com'; do for i in 'ipecho.net/plain' 'ifconfig.me' 'checkip.amazonaws.com'; do
extip=$(curl -s $i) extip=$(curl -s ${i})
[[ ! $extip ]] || break [[ ! ${extip} ]] || break
done done
# Get internal ip address # Get internal ip address
...@@ -32,17 +32,17 @@ apt-get -qq install whiptail -y ...@@ -32,17 +32,17 @@ apt-get -qq install whiptail -y
# Check to see what SickRage Dependencies are missing # Check to see what SickRage Dependencies are missing
packages=$(dpkg -l unrar-free git-core openssl libssl-dev python2.7 2>1 | grep "no packages" | \ packages=$(dpkg -l unrar-free git-core openssl libssl-dev python2.7 2>1 | grep "no packages" | \
awk '{ print $6 }' | tr '\n' ' ') awk '{ print $6 }' | tr '\n' ' ')
if [[ $packages ]]; then if [[ ${packages} ]]; then
# Show Whiptail and install required files # Show Whiptail and install required files
{ {
i=1 i=1
while read -r line; do while read -r line; do
i=$(( $i + 1 )) i=$(( $i + 1 ))
echo $i echo ${i}
done < <(apt-get update && apt-get install $packages -y) done < <(apt-get update && apt-get install ${packages} -y)
} | whiptail --title "Progress" --gauge "Installing $packages" 8 80 0 } | whiptail --title "Progress" --gauge "Installing $packages" 8 80 0
fi fi
# Check to see if all prior packages were installed sucessfully. if not exit 1 and display whiptail issues # Check to see if all prior packages were installed successfully. if not exit 1 and display whiptail issues
if [[ $(dpkg -l unrar-free git-core openssl libssl-dev python2.7 2>&1 | grep "no packages" | \ if [[ $(dpkg -l unrar-free git-core openssl libssl-dev python2.7 2>&1 | grep "no packages" | \
awk '{print $6 }') ]]; then awk '{print $6 }') ]]; then
...@@ -72,7 +72,7 @@ if [[ ! -d /opt/sickrage ]]; then ...@@ -72,7 +72,7 @@ if [[ ! -d /opt/sickrage ]]; then
else else
whiptail --title 'Overwrite?' --yesno "/opt/sickrage already exists, do you want to overwrite it?" 8 40 whiptail --title 'Overwrite?' --yesno "/opt/sickrage already exists, do you want to overwrite it?" 8 40
choice=$? choice=$?
if [[ $choice == 0 ]]; then if [[ ${choice} == 0 ]]; then
echo "Removing Old SickRage Folder And Creating New SickRage Folder" echo "Removing Old SickRage Folder And Creating New SickRage Folder"
rm -rf /opt/sickrage && mkdir /opt/sickrage && chown sickrage:sickrage /opt/sickrage rm -rf /opt/sickrage && mkdir /opt/sickrage && chown sickrage:sickrage /opt/sickrage
echo "Git Cloning In Progress" echo "Git Cloning In Progress"
...@@ -85,7 +85,7 @@ fi ...@@ -85,7 +85,7 @@ fi
# Depending on Distro, Cp the service script, then change the owner/group and change the permissions. Finally # Depending on Distro, Cp the service script, then change the owner/group and change the permissions. Finally
# start the service # start the service
if [[ $distro = ubuntu ]]; then if [[ ${distro} = ubuntu ]]; then
if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then
echo "Copying Startup Script To Upstart" echo "Copying Startup Script To Upstart"
cp /opt/sickrage/runscripts/init.upstart /etc/init/sickrage.conf cp /opt/sickrage/runscripts/init.upstart /etc/init/sickrage.conf
...@@ -106,7 +106,7 @@ if [[ $distro = ubuntu ]]; then ...@@ -106,7 +106,7 @@ if [[ $distro = ubuntu ]]; then
echo "Starting SickRage" echo "Starting SickRage"
update-rc.d sickrage defaults && service sickrage start update-rc.d sickrage defaults && service sickrage start
fi fi
elif [[ $distro = debian ]]; then elif [[ ${distro} = debian ]]; then
if [[ $(systemctl) =~ -\.mount ]]; then if [[ $(systemctl) =~ -\.mount ]]; then
echo "Copying Startup Script To systemd" echo "Copying Startup Script To systemd"
cp /opt/sickrage/runscripts/init.systemd /etc/systemd/system/sickrage.service cp /opt/sickrage/runscripts/init.systemd /etc/systemd/system/sickrage.service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment