From ac56cfa1cfd8854dba288a3981660e37d9464889 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 4 Dec 2017 20:55:26 +0000 Subject: [PATCH] Bashate fixes --- .travis.yml | 4 ++++ deluged/deluged-repository-configurator.sh | 16 +++++++-------- deluged/deluged-settings-configurator.sh | 6 +++--- deluged/deluged-update.sh | 2 +- emby-server/emby-server-installer.sh | 2 +- .../emby-server-repository-configurator.sh | 2 +- headphones/headphones-installer.sh | 6 +++--- inc/app-access-credentials.sh | 8 ++++---- inc/app-access-switch.sh | 5 +---- inc/app-autostart-configure.sh | 4 ++-- inc/app-autostart-remove-unrequired-only.sh | 8 ++++---- inc/app-folders-create.sh | 7 +++---- inc/app-init-remove.sh | 6 +++--- inc/app-password-reset.sh | 6 ++---- inc/app-port-search.sh | 4 ++-- inc/app-repository-add.sh | 2 +- inc/app-restore.sh | 9 ++++----- inc/app-set-permissions.sh | 2 +- inc/app-settings-check.sh | 5 ++--- inc/app-start.sh | 9 ++++----- inc/app-stop.sh | 10 +++++----- inc/app-systemd-add.sh | 8 ++++---- inc/app-systemd-remove.sh | 6 +++--- inc/commons.sh | 2 +- inc/consent.sh | 5 ++--- inc/db-app-user-search.sh | 2 +- inc/fileselect.sh | 10 ++++------ inc/thankyou.sh | 2 +- inc/usercheck.sh | 5 ++--- integration-tests/int-apps-install.sh | 2 +- integration-tests/int-bashate.sh | 3 +-- kodi/kodi-enable-startup.sh | 8 +++----- madsonic/madsonic-download-install.sh | 4 +--- maintenance/clearbackups.sh | 15 +++++++------- maintenance/cleartmp.sh | 20 ++++++++----------- maintenance/update.sh | 6 ++---- nzbget/nzbget-systemd-update.sh | 5 +---- plexmediaserver/plexmediaserver-constants.sh | 2 +- plexmediaserver/plexmediaserver-installer.sh | 2 +- qbittorrent-nox/qbittorrent-nox-installer.sh | 2 +- .../qbittorrent-nox-settings-configurator.sh | 3 +-- .../sabnzbdplus-repository-configurator.sh | 2 +- setup.sh | 4 ++-- subsonic/subsonic-download-install.sh | 5 +---- syncthing/syncthing-init-update.sh | 2 +- utils/bash_aliases-installer.sh | 6 ++---- utils/mono/mono-repository-configurator.sh | 2 +- utils/nginx/nginx-repository-configurator.sh | 6 +++--- utils/nginx/nginx-site-configurator.sh | 2 +- utils/nodejs/nodejs-constants.sh | 2 +- utils/nodejs/nodejs-menu.sh | 2 +- utils/php/php-menu.sh | 2 +- utils/rvm/rvm-installer.sh | 2 +- utils/rvm/rvm-menu.sh | 2 +- utils/utils-menu.sh | 2 +- 55 files changed, 123 insertions(+), 153 deletions(-) diff --git a/.travis.yml b/.travis.yml index fb36932..f11a1e7 100755 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,11 @@ language: generic sudo: required +before_install: + - sudo pip install bashate + script: + - sudo bash ./integration-tests/int-bashate.sh - sudo bash ./integration-tests/int-apps-install-uninstall.sh matrix: diff --git a/deluged/deluged-repository-configurator.sh b/deluged/deluged-repository-configurator.sh index 20467da..6650724 100755 --- a/deluged/deluged-repository-configurator.sh +++ b/deluged/deluged-repository-configurator.sh @@ -8,12 +8,12 @@ CODENAME=$(lsb_release -c -s) case "$CODENAME" in - 'squeeze'|'wheezy'|'jessie'|'stretch'|'sid') - APPREPOSITORYLINK='' - ;; - *) - REPOPPA='YES' - APPREPOSITORYLINK='ppa:deluge-team/ppa' - REPRECVKEYSHORT='249AD24C' - ;; + 'squeeze'|'wheezy'|'jessie'|'stretch'|'sid') + APPREPOSITORYLINK='' + ;; + *) + REPOPPA='YES' + APPREPOSITORYLINK='ppa:deluge-team/ppa' + REPRECVKEYSHORT='249AD24C' + ;; esac diff --git a/deluged/deluged-settings-configurator.sh b/deluged/deluged-settings-configurator.sh index 1481199..c60acdf 100755 --- a/deluged/deluged-settings-configurator.sh +++ b/deluged/deluged-settings-configurator.sh @@ -19,11 +19,11 @@ sudo sed -i "s@\"move_completed\": false@\"move_completed\": true@g" $APPSETTING sudo sed -i "s@\"move_completed_path\": \"/home/$UNAME/Downloads\"@\"move_completed_path\": \"/home/$UNAME/Downloads/deluge/completed\"@g" $APPSETTINGS || { echo -e $RED"Modifying completed location in $APPSETTINGS file failed."$ENDCOLOR; exit 1; } #Set autoadd folder enabled & destination -sudo sed -i "s@\"autoadd_enable\": false@\"autoadd_enable\": true@g" $APPSETTINGS || { echo -e $RED"Modifying autoadd_enable in $APPSETTINGS file failed."$ENDCOLOR; exit 1; } +sudo sed -i "s@\"autoadd_enable\": false@\"autoadd_enable\": true@g" $APPSETTINGS || { echo -e $RED"Modifying autoadd_enable in $APPSETTINGS file failed."$ENDCOLOR; exit 1; } sudo sed -i "s@\"autoadd_location\": \"/home/$UNAME/Downloads\"@\"autoadd_location\": \"/home/$UNAME/Downloads/deluge/autoadd\"@g" $APPSETTINGS || { echo -e $RED"Modifying watch location in $APPSETTINGS file failed."$ENDCOLOR; exit 1; } #Enable Remote Connection -sudo sed -i "s@\"allow_remote\": false@\"allow_remote\": true@g" $APPSETTINGS || { echo -e $RED"Modifying allow_remote in $APPSETTINGS file failed."$ENDCOLOR; exit 1; } +sudo sed -i "s@\"allow_remote\": false@\"allow_remote\": true@g" $APPSETTINGS || { echo -e $RED"Modifying allow_remote in $APPSETTINGS file failed."$ENDCOLOR; exit 1; } #Set autoconnect in web.conf -sudo sed -i "s@\"default_daemon\": \"\"@\"default_daemon\": \"127.0.0.1:58846\"@g" /home/$UNAME/.config/deluge/web.conf || { echo -e $RED"Modifying default_daemon in $APPSETTINGS file failed."$ENDCOLOR; exit 1; } +sudo sed -i "s@\"default_daemon\": \"\"@\"default_daemon\": \"127.0.0.1:58846\"@g" /home/$UNAME/.config/deluge/web.conf || { echo -e $RED"Modifying default_daemon in $APPSETTINGS file failed."$ENDCOLOR; exit 1; } diff --git a/deluged/deluged-update.sh b/deluged/deluged-update.sh index e1f0c97..119137f 100755 --- a/deluged/deluged-update.sh +++ b/deluged/deluged-update.sh @@ -10,7 +10,7 @@ source "$SCRIPTPATH/inc/commons.sh" source "$SCRIPTPATH/inc/header.sh" echo -e "${GREEN}AtoMiC $APPTITLE Update Script$ENDCOLOR" source "$SCRIPTPATH/inc/pause.sh" -if DoesAppFolderExist; then +if DoesAppFolderExist; then source "$SCRIPTPATH/inc/app-stop.sh" source "$SCRIPTPATH/utils/nzbtomedia/nzbtomedia-update.sh" source "$SCRIPTPATH/deluged/deluged-constants.sh" diff --git a/emby-server/emby-server-installer.sh b/emby-server/emby-server-installer.sh index cfcb926..84c06de 100755 --- a/emby-server/emby-server-installer.sh +++ b/emby-server/emby-server-installer.sh @@ -26,7 +26,7 @@ source "$SCRIPTPATH/inc/app-start.sh" echo "Waiting for $APPTITLE to finish initial setup" sleep 30 echo "Now stop and start again" -source "$SCRIPTPATH/inc/app-stop.sh" +source "$SCRIPTPATH/inc/app-stop.sh" source "$SCRIPTPATH/inc/app-start.sh" source "$SCRIPTPATH/inc/app-install-confirmation.sh" source "$SCRIPTPATH/inc/thankyou.sh" diff --git a/emby-server/emby-server-repository-configurator.sh b/emby-server/emby-server-repository-configurator.sh index 609b242..e2ff90a 100755 --- a/emby-server/emby-server-repository-configurator.sh +++ b/emby-server/emby-server-repository-configurator.sh @@ -14,7 +14,7 @@ fi CODENAME=$(lsb_release -c -s) if [ "$TEMPDIST" = '' ]; then - case "$CODENAME" in + case "$CODENAME" in 'sid') TEMPDIST='Debian_Next' ;; diff --git a/headphones/headphones-installer.sh b/headphones/headphones-installer.sh index 2576016..0dbd990 100755 --- a/headphones/headphones-installer.sh +++ b/headphones/headphones-installer.sh @@ -20,14 +20,14 @@ source "$SCRIPTPATH/inc/app-autostart-configure.sh" source "$SCRIPTPATH/inc/app-set-permissions.sh" source "$SCRIPTPATH/inc/app-start.sh" echo "Waiting for $APPTITLE to finish initial setup" -sleep 20 +sleep 20 echo "Now stop to create the $APPSETTINGS file" -source "$SCRIPTPATH/inc/app-stop.sh" +source "$SCRIPTPATH/inc/app-stop.sh" echo echo 'Set to Network Access' sudo sed -i "s@${ACCESSHOST}localhost@${ACCESSHOST}0.0.0.0@g" $APPSETTINGS || { echo -e $RED'Modifying '$ACCESSHOST' in '$APPSETTINGS' file failed.'$ENDCOLOR; exit 1; } -source "$SCRIPTPATH/inc/app-start.sh" +source "$SCRIPTPATH/inc/app-start.sh" source "$SCRIPTPATH/inc/app-install-confirmation.sh" source "$SCRIPTPATH/inc/thankyou.sh" diff --git a/inc/app-access-credentials.sh b/inc/app-access-credentials.sh index e3c93e3..164b8b5 100755 --- a/inc/app-access-credentials.sh +++ b/inc/app-access-credentials.sh @@ -3,7 +3,7 @@ echo sleep 1 if grep -q "reset.sh" "$SCRIPTPATH/$APPNAME/$APPNAME-menu.sh"; then - RESETSUPPORT="If you forgot, you may use the AtoMiC $APPTITLE password reset utility." + RESETSUPPORT="If you forgot, you may use the AtoMiC $APPTITLE password reset utility." else RESETSUPPORT='' fi @@ -17,7 +17,7 @@ echo -e "--->${CYAN}Password: ${RED}Not displayed for security.$ENDCOLOR$RESETSU if [[ -z $UIPASSSTATUS ]] && [[ ! -z $APPDEFAULTPASS ]]; then echo -e "Try default password: $GREEN$APPDEFAULTPASS$ENDCOLOR" fi -echo +echo sleep 1 if [[ ! $APPUSESNGINX = 'YES' ]]; then @@ -39,11 +39,11 @@ if [[ ! $APPUSESNGINX = 'YES' ]]; then [[ -f /lib/systemd/system/$APPSYSTEMD ]] || \ [[ -f /usr/lib/systemd/system/$APPSYSTEMD ]] || \ [[ -L /etc/systemd/system/multi-user.target.wants/$APPSYSTEMD ]] ; then - + echo -e "SYSTEMD $APPSYSTEMD found.$ENDCOLOR" STATUS=$(systemctl is-active $APPSYSTEMD) if [[ $STATUS = 'active' ]]; then - echo -e "$APPSYSTEMD is currently: ${GREEN}$STATUS$ENDCOLOR" + echo -e "$APPSYSTEMD is currently: ${GREEN}$STATUS$ENDCOLOR" else echo -e "$APPSYSTEMD is currently: ${RED}$STATUS$ENDCOLOR" fi diff --git a/inc/app-access-switch.sh b/inc/app-access-switch.sh index 660a2cb..c3e9a17 100755 --- a/inc/app-access-switch.sh +++ b/inc/app-access-switch.sh @@ -10,8 +10,7 @@ source "$SCRIPTPATH/inc/pause.sh" if DoesAppFolderExist; then source "$SCRIPTPATH/inc/app-settings-check.sh" - echo - sleep 2 + echo source "$SCRIPTPATH/inc/app-stop.sh" sleep 2 echo @@ -24,9 +23,7 @@ if DoesAppFolderExist; then sudo sed -i "s@^${ACCESSHOST}localhost@${ACCESSHOST}0.0.0.0@g" $APPSETTINGS || { echo -e $RED'Modifying '$ACCESSHOST' in '$APPSETTINGS' file failed.'$ENDCOLOR; exit 1; } fi - sleep 2 source "$SCRIPTPATH/inc/app-start.sh" - sleep 2 echo echo -e $GREEN'--->All done. '$APPTITLE' access switch complete.'$ENDCOLOR diff --git a/inc/app-autostart-configure.sh b/inc/app-autostart-configure.sh index e4cceb3..70a6adc 100755 --- a/inc/app-autostart-configure.sh +++ b/inc/app-autostart-configure.sh @@ -4,14 +4,14 @@ echo source "$SCRIPTPATH/inc/app-stop.sh" echo echo -e "$YELLOW--->Autostart configuring...$ENDCOLOR" -if IsSystemdSupported; then +if IsSystemdSupported; then echo 'Using systemd' source "$SCRIPTPATH/inc/app-init-remove.sh" source "$SCRIPTPATH/inc/app-systemd-add.sh" source "$SCRIPTPATH/$APPNAME/$APPNAME-systemd-update.sh" -elif [[ -d /etc/init.d ]]; then +elif [[ -d /etc/init.d ]]; then echo 'Using sysv-init' source "$SCRIPTPATH/inc/app-systemd-remove.sh" diff --git a/inc/app-autostart-remove-unrequired-only.sh b/inc/app-autostart-remove-unrequired-only.sh index ddb415a..1ce9fb2 100755 --- a/inc/app-autostart-remove-unrequired-only.sh +++ b/inc/app-autostart-remove-unrequired-only.sh @@ -4,19 +4,19 @@ echo source "$SCRIPTPATH/inc/app-stop.sh" echo echo -e "$YELLOW--->Autostart Removing any unrequired files...$ENDCOLOR" -if IsSystemdSupported; then +if IsSystemdSupported; then echo 'Using systemd so removing any sysv-init files' source "$SCRIPTPATH/inc/app-init-remove.sh" >/dev/null sudo systemctl daemon-reload - sudo systemctl enable $APPSYSTEMD + sudo systemctl enable $APPSYSTEMD -elif [[ -d /etc/init.d ]]; then +elif [[ -d /etc/init.d ]]; then echo 'Using sysv-init so removing any systemd files' source "$SCRIPTPATH/inc/app-systemd-remove.sh" >/dev/null sudo chown $UNAME:$UGROUP /etc/init.d/$APPINITD sudo update-rc.d $APPINITD defaults -else +else echo -e "${RED}Unknown startup type.$ENDCOLOR" fi diff --git a/inc/app-folders-create.sh b/inc/app-folders-create.sh index 4686648..1748a05 100755 --- a/inc/app-folders-create.sh +++ b/inc/app-folders-create.sh @@ -4,9 +4,9 @@ sleep 1 echo -e "$YELLOW--->Creating $APPTITLE files / folders...$ENDCOLOR" if [[ -f $SCRIPTPATH/utils/$APPNAME/$APPNAME-folders-list ]]; then - cp $SCRIPTPATH/utils/$APPNAME/$APPNAME-folders-list $SCRIPTPATH/tmp/$APPSHORTNAME-folders-list || { echo -e "${RED}Creating folders list failed.$ENDCOLOR"; exit 1; } + cp $SCRIPTPATH/utils/$APPNAME/$APPNAME-folders-list $SCRIPTPATH/tmp/$APPSHORTNAME-folders-list || { echo -e "${RED}Creating folders list failed.$ENDCOLOR"; exit 1; } else - cp $SCRIPTPATH/$APPNAME/$APPNAME-folders-list $SCRIPTPATH/tmp/$APPSHORTNAME-folders-list || { echo -e "${RED}Creating folders list failed.$ENDCOLOR"; exit 1; } + cp $SCRIPTPATH/$APPNAME/$APPNAME-folders-list $SCRIPTPATH/tmp/$APPSHORTNAME-folders-list || { echo -e "${RED}Creating folders list failed.$ENDCOLOR"; exit 1; } fi sudo sed -i "s@APPPATH@$APPPATH@g" $SCRIPTPATH/tmp/$APPSHORTNAME-folders-list || { echo -e "${RED}Replacing $APPTITLE path in folders list failed.$ENDCOLOR"; exit 1; } @@ -14,8 +14,7 @@ sudo sed -i "s@APPSETTINGSDIR@$APPSETTINGSDIR@g" $SCRIPTPATH/tmp/$APPSHORTNAME-f sudo sed -i "s@UNAME@$UNAME@g" $SCRIPTPATH/tmp/$APPSHORTNAME-folders-list || { echo -e "${RED}Replacing username in folders list failed.$ENDCOLOR"; exit 1; } #Need encapsulate the $folder for folders with spaces -while IFS= read -r folder -do +while IFS= read -r folder; do echo -e 'Creating '$CYAN$folder$ENDCOLOR'...' if [[ ! -d $folder ]]; then mkdir -p "$folder" diff --git a/inc/app-init-remove.sh b/inc/app-init-remove.sh index 3bd7b3d..f8ee1a3 100755 --- a/inc/app-init-remove.sh +++ b/inc/app-init-remove.sh @@ -9,12 +9,12 @@ if [[ -f /etc/init.d/$APPINITD ]]; then sudo rm /etc/init.d/$APPINITD || { echo -e $RED'Warning! Removing init script failed.'$ENDCOLOR ; } echo "/etc/init.d/$APPINITD init script removed" else - echo "/etc/init.d/$APPINITD init script not found" + echo "/etc/init.d/$APPINITD init script not found" fi #Remove the PID file and folder if it exists if [[ -d /var/run/$APPNAME ]]; then -sudo rm -r /var/run/$APPNAME + sudo rm -r /var/run/$APPNAME fi #Remove a conf file if there is one @@ -30,5 +30,5 @@ if [[ -f /etc/default/$APPNAME ]]; then sudo rm /etc/default/$APPNAME || { echo -e $RED'Warning! Removing default script failed.'$ENDCOLOR ; } echo "/etc/default/$APPNAME default script removed" else - echo "/etc/default/$APPNAME default script not found" + echo "/etc/default/$APPNAME default script not found" fi diff --git a/inc/app-password-reset.sh b/inc/app-password-reset.sh index a5e46a8..640f4f8 100755 --- a/inc/app-password-reset.sh +++ b/inc/app-password-reset.sh @@ -1,9 +1,7 @@ #!/bin/bash -echo +echo sleep 1 -if [ ! -z $UINAMESTATUS ]; then - #echo 'old password line: '$PASSSEARCH$UIPASS - #echo 'new password line: '$PASSSEARCH$NEWPASS +if [[ ! -z $UINAMESTATUS ]]; then echo -e $YELLOW'Setting temporary '$APPTITLE' WebUI password...'$ENDCOLOR sed -i 's|'"$PASSSEARCH$UIPASS"'|'"$PASSSEARCH$NEWPASS"'|g' $APPSETTINGS || { echo -e $RED'Setting temporary password failed.'$ENDCOLOR ; exit 1; } echo -e 'Password set to: '$GREEN$APPNEWPASS$ENDCOLOR diff --git a/inc/app-port-search.sh b/inc/app-port-search.sh index 0893a91..d3a42a2 100755 --- a/inc/app-port-search.sh +++ b/inc/app-port-search.sh @@ -2,13 +2,13 @@ echo -e "$YELLOW--->Searching for possible port numbers...$ENDCOLOR" if [[ -n $APPDPORT ]]; then - echo -e "${CYAN}Default port: $ENDCOLOR$GREEN$APPDPORT$ENDCOLOR found in AtoMiC-ToolKit config." + echo -e "${CYAN}Default port: $ENDCOLOR$GREEN$APPDPORT$ENDCOLOR found in AtoMiC-ToolKit config." fi if [[ $PORTSEARCH == "NA" ]] || [[ -z $APPSETTINGS ]]; then echo -e "Cannot determine port set in $CYAN$APPTITLE$ENDCOLOR config." else - PORTSTRING=$(grep "$PORTSEARCH" $APPSETTINGS | grep -v "https" | head -1 | sed -e "s#.*$PORTSEARCH\\(\\)#\\1#") + PORTSTRING=$(grep "$PORTSEARCH" $APPSETTINGS | grep -v "https" | head -1 | sed -e "s#.*$PORTSEARCH\\(\\)#\\1#") if [[ -n $PORTSTRING ]]; then echo -e "${CYAN}Configured port: $ENDCOLOR$GREEN${PORTSTRING//[!0-9]/}$ENDCOLOR found in $APPSETTINGS." fi diff --git a/inc/app-repository-add.sh b/inc/app-repository-add.sh index c031261..e82da54 100755 --- a/inc/app-repository-add.sh +++ b/inc/app-repository-add.sh @@ -10,7 +10,7 @@ if [ ! "$APPREPOSITORYLINK" = "" ]; then else #Add the key echo "$APPREPOSITORYLINK" | sudo tee -a /etc/apt/sources.list.d/$APPREPOSITORYNAME.list - + #Check if backup required and add if needed if [ ! "$APPREPOSITORYLINKBACKUP" = "" ]; then if [ "$GREPOUTBACK" = "" ]; then diff --git a/inc/app-restore.sh b/inc/app-restore.sh index 2b694b4..4b2e3ce 100755 --- a/inc/app-restore.sh +++ b/inc/app-restore.sh @@ -15,13 +15,12 @@ if [[ $exitstatus = 0 ]]; then echo sleep 1 - + #http://www.cyberciti.biz/faq/bash-loop-over-file/ echo -e $YELLOW'--->Checking for existing files...'$ENDCOLOR DATETIME=`date '+%m-%d-%Y_%H-%M'` - - while IFS= read -r file - do + + while IFS= read -r file; do echo -e "Restoring $CYAN$file$ENDCOLOR..." if [[ -f $file ]] || [[ -d $file ]]; then NEWFILENAME=$file'_'$DATETIME @@ -41,4 +40,4 @@ if [[ $exitstatus = 0 ]]; then else echo echo -e "${RED}Restoring $APPTITLE backup cancelled.$ENDCOLOR" -fi +fi diff --git a/inc/app-set-permissions.sh b/inc/app-set-permissions.sh index fede00e..3afdc2b 100755 --- a/inc/app-set-permissions.sh +++ b/inc/app-set-permissions.sh @@ -12,5 +12,5 @@ if [[ ! -z $APPSETTINGSDIR ]] && [[ -d $APPSETTINGSDIR ]]; then sudo chown -R $UNAME:$UGROUP "$APPSETTINGSDIR" sudo chmod -R 775 "$APPSETTINGSDIR" sudo chmod -R g+s "$APPSETTINGSDIR" - echo -e "$CYAN$APPSETTINGSDIR$ENDCOLOR Done" + echo -e "$CYAN$APPSETTINGSDIR$ENDCOLOR Done" fi diff --git a/inc/app-settings-check.sh b/inc/app-settings-check.sh index 544c0b6..d784389 100755 --- a/inc/app-settings-check.sh +++ b/inc/app-settings-check.sh @@ -1,8 +1,7 @@ #!/bin/bash -if [ ! -f "$APPSETTINGS" ]; -then +if [ ! -f "$APPSETTINGS" ]; then echo -e $RED $APPSETTINGS 'not found. '$ENDCOLOR$APPTITLE' not installed or incompatible installation. - Please open '$APPNAME', and try saving the config first else you may need to reinstall. '$ENDCOLOR + Please open '$APPNAME', and try saving the config first else you may need to reinstall. '$ENDCOLOR echo -e ' Exiting. If '$APPTITLE' is installed, use '$CYAN'sudo ./setup.sh'$ENDCOLOR' to start it.' echo cd $SCRIPTPATH diff --git a/inc/app-start.sh b/inc/app-start.sh index 3852cdc..3bf4bf5 100755 --- a/inc/app-start.sh +++ b/inc/app-start.sh @@ -7,13 +7,13 @@ if IsSystemdSupported; then [[ -f /lib/systemd/system/$APPSYSTEMD ]] || \ [[ -f /usr/lib/systemd/system/$APPSYSTEMD ]] || \ [[ -L /etc/systemd/system/multi-user.target.wants/$APPSYSTEMD ]] ; then - + FOUND=1 sudo systemctl start "$APPSYSTEMD" sleep 5 STATUS=$(systemctl is-active "$APPSYSTEMD") if [[ $STATUS = 'active' ]]; then - echo -e "$APPSYSTEMD is now: ${GREEN}$STATUS$ENDCOLOR" + echo -e "$APPSYSTEMD is now: ${GREEN}$STATUS$ENDCOLOR" else echo -e "$APPSYSTEMD is now: ${RED}$STATUS$ENDCOLOR" fi @@ -22,13 +22,13 @@ if IsSystemdSupported; then if [[ -f /etc/systemd/system/$APPSYSTEMD2 ]] || \ [[ -f /lib/systemd/system/$APPSYSTEMD2 ]] || \ [[ -f /usr/lib/systemd/system/$APPSYSTEMD2 ]] || \ - [[ -L /etc/systemd/system/multi-user.target.wants/$APPSYSTEMD2 ]] ; then + [[ -L /etc/systemd/system/multi-user.target.wants/$APPSYSTEMD2 ]]; then FOUND=1 sudo systemctl start "$APPSYSTEMD2" sleep 5 STATUS=$(systemctl is-active "$APPSYSTEMD2") if [[ $STATUS = 'active' ]]; then - echo -e "$APPSYSTEMD2 is now: ${GREEN}$STATUS$ENDCOLOR" + echo -e "$APPSYSTEMD2 is now: ${GREEN}$STATUS$ENDCOLOR" else echo -e "$APPSYSTEMD2 is now: ${RED}$STATUS$ENDCOLOR" fi @@ -41,4 +41,3 @@ fi if [[ ! -z $FOUND ]] && [[ $FOUND = 0 ]]; then echo -e "${RED}Startup file not found.$ENDCOLOR" fi - \ No newline at end of file diff --git a/inc/app-stop.sh b/inc/app-stop.sh index 7b2f57c..5545270 100755 --- a/inc/app-stop.sh +++ b/inc/app-stop.sh @@ -1,5 +1,5 @@ #!/bin/bash -echo +echo echo -e "${YELLOW}--->Stopping $APPTITLE...$ENDCOLOR" if IsSystemdSupported; then @@ -7,12 +7,12 @@ if IsSystemdSupported; then [[ -f /lib/systemd/system/$APPSYSTEMD ]] || \ [[ -f /usr/lib/systemd/system/$APPSYSTEMD ]] || \ [[ -L /etc/systemd/system/multi-user.target.wants/$APPSYSTEMD ]] ; then - + FOUND=1 sudo systemctl stop "$APPSYSTEMD" STATUS=$(systemctl is-active "$APPSYSTEMD") if [[ $STATUS = 'active' ]]; then - echo -e "$APPSYSTEMD is now: ${GREEN}$STATUS$ENDCOLOR" + echo -e "$APPSYSTEMD is now: ${GREEN}$STATUS$ENDCOLOR" else echo -e "$APPSYSTEMD is now: ${RED}$STATUS$ENDCOLOR" fi @@ -26,12 +26,12 @@ if IsSystemdSupported; then sudo systemctl stop "$APPSYSTEMD2" STATUS=$(systemctl is-active "$APPSYSTEMD2") if [[ $STATUS = 'active' ]]; then - echo -e "$APPSYSTEMD2 is now: ${GREEN}$STATUS$ENDCOLOR" + echo -e "$APPSYSTEMD2 is now: ${GREEN}$STATUS$ENDCOLOR" else echo -e "$APPSYSTEMD2 is now: ${RED}$STATUS$ENDCOLOR" fi fi -fi +fi if [[ -f /etc/init.d/$APPINITD ]]; then FOUND=3 diff --git a/inc/app-systemd-add.sh b/inc/app-systemd-add.sh index d34a01e..f1e7abe 100755 --- a/inc/app-systemd-add.sh +++ b/inc/app-systemd-add.sh @@ -25,17 +25,17 @@ fi # Some apps require an override to prevent the systemd file getting overwritten if [[ -n $APPSYSTEMDOVERIDE ]]; then - APPSYSTEMDOVERIDELOC="/etc/systemd/system/$APPNAME.service.d" + APPSYSTEMDOVERIDELOC="/etc/systemd/system/$APPNAME.service.d" if [[ ! -d $APPSYSTEMDOVERIDELOC ]]; then sudo mkdir -p $APPSYSTEMDOVERIDELOC sudo chown $UNAME:$UGROUP $APPSYSTEMDOVERIDELOC || { echo -e "${RED}Chown on $folder failed.$ENDCOLOR"; exit 1; } - fi + fi sudo cp -R "$APPSYSTEMDOVERIDE" \ "/etc/systemd/system/$APPNAME.service.d/override.conf" \ || { echo -e "${RED}Creating systemd override file failed.$ENDCOLOR" ; exit 1; } - + sudo chmod -R 755 $APPSYSTEMDOVERIDELOC || { echo -e "${RED}Chmod on $folder failed.$ENDCOLOR"; exit 1; } - + echo "$APPSYSTEMD SystemD override script added" fi diff --git a/inc/app-systemd-remove.sh b/inc/app-systemd-remove.sh index d0f8d8d..10a8bd8 100755 --- a/inc/app-systemd-remove.sh +++ b/inc/app-systemd-remove.sh @@ -11,12 +11,12 @@ if [[ -n $APPSYSTEMD ]]; then [[ -f /lib/systemd/system/$APPSYSTEMD ]] || \ [[ -f /usr/lib/systemd/system/$APPSYSTEMD ]] || \ [[ -L /etc/systemd/system/multi-user.target.wants/$APPSYSTEMD ]] ; then - + if IsSystemdSupported; then sudo systemctl stop "$APPSYSTEMD" sudo systemctl disable "$APPSYSTEMD" fi - + sudo rm "/etc/systemd/system/.$APPSYSTEMD.swp" >/dev/null 2>&1 sudo rm "/etc/systemd/system/$APPSYSTEMD" >/dev/null 2>&1 sudo rm "/lib/systemd/system/$APPSYSTEMD" >/dev/null 2>&1 @@ -43,7 +43,7 @@ if [[ -n $APPSYSTEMD2 ]]; then sudo rm "/etc/systemd/system/.$APPSYSTEMD2.swp" >/dev/null 2>&1 sudo rm "/etc/systemd/system/$APPSYSTEMD2" >/dev/null 2>&1 sudo rm "/lib/systemd/system/$APPSYSTEMD2" >/dev/null 2>&1 - sudo rm "/usr/lib/systemd/system/$APPSYSTEMD2" >/dev/null 2>&1 + sudo rm "/usr/lib/systemd/system/$APPSYSTEMD2" >/dev/null 2>&1 sudo rm "/etc/systemd/system/multi-user.target.wants/$APPSYSTEMD2" >/dev/null 2>&1 echo "$APPSYSTEMD2 SystemD script removed" diff --git a/inc/commons.sh b/inc/commons.sh index 3039d70..518c923 100755 --- a/inc/commons.sh +++ b/inc/commons.sh @@ -11,7 +11,7 @@ COLUMNS=78 NETLINES=16 pause(){ - read -p "$*" + read -p "$*" } IsSystemdSupported() diff --git a/inc/consent.sh b/inc/consent.sh index ad5b5c5..594284b 100755 --- a/inc/consent.sh +++ b/inc/consent.sh @@ -11,8 +11,7 @@ echo read -p 'Type y/Y and press [ENTER] to AGREE and continue with the installation or any other key to exit: ' RESP=${REPLY,,} -if [ "$RESP" != "y" ] -then +if [ "$RESP" != "y" ]; then echo echo -e "${RED}Because you disagreed to the disclaimers, no changes were made. If you change your mind, you may rerun ToolKit later.$ENDCOLOR" echo @@ -21,4 +20,4 @@ else echo "Agreed to disclaimers: $(date)" >> "$SCRIPTPATH/tmp/consented" fi -echo +echo diff --git a/inc/db-app-user-search.sh b/inc/db-app-user-search.sh index 32af20e..060f96e 100755 --- a/inc/db-app-user-search.sh +++ b/inc/db-app-user-search.sh @@ -7,7 +7,7 @@ if [[ $DBUSERSEARCH = "NA" ]] || [[ $APPSETTINGSDB = "NA" ]]; then UINAME='Cannot determine or username not set.' else UINAME=$(echo "$DBUSERSEARCH" | sqlite3 "$APPSETTINGSDB") - + if [[ ! -z $UINAME ]] && [[ $UINAME != "" ]]; then echo -e "Found. Using username: $UINAME"; UINAMESTATUS="Set" diff --git a/inc/fileselect.sh b/inc/fileselect.sh index 44bf951..2e360a6 100755 --- a/inc/fileselect.sh +++ b/inc/fileselect.sh @@ -3,11 +3,9 @@ cd "$SCRIPTPATH/backups" FILES=(*) cd $SCRIPTPATH FILELIST=() -for ((i=0; i<${#FILES[@]}; i++)) -do - if [[ ${FILES[$i]} == *"$APPNAME"* ]] - then - FILELIST+=("${FILES[$i]}" "") +for ((i=0; i<${#FILES[@]}; i++)); do + if [[ ${FILES[$i]} == *"$APPNAME"* ]]; then + FILELIST+=("${FILES[$i]}" "") fi done @@ -15,7 +13,7 @@ if [[ -z "$FILELIST" ]]; then echo -e "${RED}No '$APPNAME' backups were found in '$CYAN$SCRIPTPATH'/backups folder. Cannot perform restore. Returning to menu.$ENDCOLOR" source "$SCRIPTPATH/inc/pause.sh" source "$SCRIPTPATH/$APPNAME/$APPNAME-menu.sh" -else +else FILECHOICE=$(whiptail --title "AtoMiC ToolKit - Restore Backup" --menu "Select the backup file you want to restore:" --backtitle "$BACKTITLE" --fb --ok-button "Select" $LINES $COLUMNS $NETLINES "${FILELIST[@]}" 3>&1 1>&2 2>&3) exitstatus=$? fi diff --git a/inc/thankyou.sh b/inc/thankyou.sh index 5eb5534..ad8d9bc 100755 --- a/inc/thankyou.sh +++ b/inc/thankyou.sh @@ -4,4 +4,4 @@ if [[ -z $CI ]]; then echo -e "${YELLOW}Thank you for using the ${CYAN}AtoMiC ToolKit$YELLOW." echo -e "${YELLOW}Please visit ${CYAN}http://forum.htpcbeginner.com ${YELLOW}to discuss or raise any issues." echo -e "${YELLOW}You can also follow ${CYAN}htpcBeginner$YELLOW through ${CYAN}Facebook$YELLOW, ${CYAN}Twitter$YELLOW, ${CYAN}Google+$YELLOW, ${CYAN}YouTube$YELLOW, or ${CYAN}RSS$YELLOW.$ENDCOLOR" -fi \ No newline at end of file +fi diff --git a/inc/usercheck.sh b/inc/usercheck.sh index 64e2121..fde9510 100755 --- a/inc/usercheck.sh +++ b/inc/usercheck.sh @@ -13,9 +13,8 @@ else rm "$SCRIPTPATH/tmp/userinfo" >/dev/null 2>&1 echo "UNAME=$UNAME" >> "$SCRIPTPATH/tmp/userinfo" echo "UGROUP=$UGROUP" >> "$SCRIPTPATH/tmp/userinfo" - if [ ! -z "$ARGS" ]; - then - source "$SCRIPTPATH/inc/option-handler.sh" + if [ ! -z "$ARGS" ]; then + source "$SCRIPTPATH/inc/option-handler.sh" fi fi diff --git a/integration-tests/int-apps-install.sh b/integration-tests/int-apps-install.sh index a443459..a557468 100755 --- a/integration-tests/int-apps-install.sh +++ b/integration-tests/int-apps-install.sh @@ -64,4 +64,4 @@ source "$SCRIPTPATH/setup.sh" -i transmission-daemon source "$SCRIPTPATH/setup.sh" -i ubooquity source "$SCRIPTPATH/setup.sh" -i watcher source "$SCRIPTPATH/setup.sh" -i webmin -source "$SCRIPTPATH/inc/thankyou.sh" \ No newline at end of file +source "$SCRIPTPATH/inc/thankyou.sh" diff --git a/integration-tests/int-bashate.sh b/integration-tests/int-bashate.sh index fc77c6b..a85ed27 100755 --- a/integration-tests/int-bashate.sh +++ b/integration-tests/int-bashate.sh @@ -4,5 +4,4 @@ # Publisher: http://www.htpcBeginner.com # License: MIT License (refer to README.md for more details) -# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING. -find . -name '*.sh' | xargs bashate +find . -name '*.sh' | xargs bashate -i E006 diff --git a/kodi/kodi-enable-startup.sh b/kodi/kodi-enable-startup.sh index 5163272..add9a3f 100755 --- a/kodi/kodi-enable-startup.sh +++ b/kodi/kodi-enable-startup.sh @@ -4,17 +4,15 @@ # Publisher: http://www.htpcBeginner.com # License: MIT License (refer to README.md for more details) -# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING. - source "$SCRIPTPATH/inc/app-setup-check.sh" source "$SCRIPTPATH/inc/app-autostart-configure.sh" APPDEPS='xorg dbus-x11 xserver-xorg-legacy' source "$SCRIPTPATH/inc/app-install-deps.sh" dpkg-reconfigure x11-common >/dev/null 2>&1 sudo sed -i '/allowed_users/c\allowed_users=anybody' /etc/X11/Xwrapper.config || { echo -e $RED'Adding allowed_users in Xwrapper.config file failed.'$ENDCOLOR; exit 1; } -if ! grep -qF 'needs_root_rights=yes' /etc/X11/Xwrapper.config;then - echo 'needs_root_rights=yes' >> /etc/X11/Xwrapper.config - echo +if ! grep -qF 'needs_root_rights=yes' /etc/X11/Xwrapper.config; then + echo 'needs_root_rights=yes' >> /etc/X11/Xwrapper.config + echo fi source "$SCRIPTPATH/inc/pause.sh" diff --git a/madsonic/madsonic-download-install.sh b/madsonic/madsonic-download-install.sh index 3043fde..f68602c 100755 --- a/madsonic/madsonic-download-install.sh +++ b/madsonic/madsonic-download-install.sh @@ -4,9 +4,7 @@ # Publisher: http://www.htpcBeginner.com # License: MIT License (refer to README.md for more details) -# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING. - -FILE=$(curl -s http://beta.madsonic.org/pages/download62.jsp | grep -o '".*"' | grep -o '.*\.deb' | grep -oP '(?<=target=).*' | sed 's/"//g' | head -1) +FILE=$(curl -s http://beta.madsonic.org/pages/download62.jsp | grep -o '".*"' | grep -o '.*\.deb' | grep -oP '(?<=target=).*' | sed 's/"//g' | head -1) echo echo -e $YELLOW"File Found: ${FILE}"$ENDCOLOR SHORTVERSION=${FILE:18:3} diff --git a/maintenance/clearbackups.sh b/maintenance/clearbackups.sh index 672cf78..f719b8e 100755 --- a/maintenance/clearbackups.sh +++ b/maintenance/clearbackups.sh @@ -13,14 +13,14 @@ source "$SCRIPTPATH/inc/header.sh" echo -e $GREEN'AtoMiC ToolKit Backups Cleaner'$ENDCOLOR -echo +echo target=$SCRIPTPATH/backups/ if find "$target" -mindepth 1 -print -quit | grep -q .; then echo -e $YELLOW'--->Below are the backups folder contents...'$ENDCOLOR ls -l $SCRIPTPATH/backups/* - - echo + + echo sleep 1 echo -e $GREEN'Delete all backups?'$ENDCOLOR @@ -28,13 +28,12 @@ if find "$target" -mindepth 1 -print -quit | grep -q .; then read -p 'Type y/Y and press [ENTER] to delete or any other key to exit: ' RESP=${REPLY,,} - echo - - if [ "$RESP" == "y" ] - then + echo + + if [ "$RESP" == "y" ]; then echo -e $YELLOW'--->Deleting all backups...'$ENDCOLOR rm $SCRIPTPATH/backups/* >/dev/null 2>&1 - if find "$target" -mindepth 1 -print -quit | grep -q .; then + if find "$target" -mindepth 1 -print -quit | grep -q .; then echo -e $RED'Deleting backups failed.'$ENDCOLOR else echo -e 'All backups deleted successfully.' diff --git a/maintenance/cleartmp.sh b/maintenance/cleartmp.sh index 053b9c5..aa57a31 100755 --- a/maintenance/cleartmp.sh +++ b/maintenance/cleartmp.sh @@ -3,9 +3,6 @@ # Author: TommyE123 # Publisher: http://www.htpcBeginner.com # License: MIT License (refer to README.md for more details) -# - -# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING. source "$SCRIPTPATH/inc/app-setup-check.sh" source "$SCRIPTPATH/inc/commons.sh" @@ -13,28 +10,27 @@ source "$SCRIPTPATH/inc/header.sh" echo -e $GREEN'AtoMiC ToolKit Temporary Data Cleaner'$ENDCOLOR -echo +echo target=$SCRIPTPATH/tmp/ if find "$target" -mindepth 1 -print -quit | grep -q .; then echo -e $YELLOW'--->Below are the tmp folder contents...'$ENDCOLOR ls -l $SCRIPTPATH/tmp/* - - echo + + echo sleep 1 echo -e $GREEN'Delete all temporary data?'$ENDCOLOR - echo -e 'Temporary data can be safely deleted and recreated.' + echo -e 'Temporary data can be safely deleted and recreated.' read -p 'Type y/Y and press [ENTER] to delete or any other key to exit: ' RESP=${REPLY,,} - echo - - if [ "$RESP" == "y" ] - then + echo + + if [ "$RESP" == "y" ]; then echo -e $YELLOW'--->Deleting all temporary...'$ENDCOLOR rm $SCRIPTPATH/tmp/* >/dev/null 2>&1 - if find "$target" -mindepth 1 -print -quit | grep -q .; then + if find "$target" -mindepth 1 -print -quit | grep -q .; then echo -e $RED'Deleting temporary data failed.'$ENDCOLOR else echo -e 'All temporary data deleted successfully.' diff --git a/maintenance/update.sh b/maintenance/update.sh index e59c5df..58a3553 100755 --- a/maintenance/update.sh +++ b/maintenance/update.sh @@ -11,13 +11,11 @@ source "$SCRIPTPATH/inc/commons.sh" source "$SCRIPTPATH/inc/header.sh" echo -e "${GREEN}AtoMiC ToolKit Updater$ENDCOLOR" - -echo - +echo echo -e "${GREEN}This will overwrite any manual changes you made to the script.$ENDCOLOR" read -p 'Type y/Y and press [ENTER] to continue with update or any other key to exit: ' RESP=${REPLY,,} - + if [[ $RESP == 'y' ]]; then source "$SCRIPTPATH/inc/pkgupdate.sh" APPPATH=$SCRIPTPATH diff --git a/nzbget/nzbget-systemd-update.sh b/nzbget/nzbget-systemd-update.sh index 9d8cd43..58f3b83 100755 --- a/nzbget/nzbget-systemd-update.sh +++ b/nzbget/nzbget-systemd-update.sh @@ -3,9 +3,6 @@ # Author: TommyE123 # Publisher: http://www.htpcBeginner.com # License: MIT License (refer to README.md for more details) -# - -# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING. sudo sed -i "s@User=ReplaceMe@User=$UNAME@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Modifying USER in SYSTEMD file failed.'$ENDCOLOR; exit 1; } sudo sed -i "s@Group=ReplaceMe@Group=$UGROUP@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Modifying GROUP in SYSTEMD file failed.'$ENDCOLOR; exit 1; } @@ -13,6 +10,6 @@ sudo sed -i "s@Group=ReplaceMe@Group=$UGROUP@g" /etc/systemd/system/$APPSYSTEMD sudo sed -i "s@ExecStart= -D@ExecStart=$APPPATH/nzbget -D@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Modifying GROUP in SYSTEMD file failed.'$ENDCOLOR; exit 1; } sudo sed -i "s@ExecStop= -Q@ExecStop=$APPPATH/nzbget -Q@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Modifying GROUP in SYSTEMD file failed.'$ENDCOLOR; exit 1; } sudo sed -i "s@ExecReload= -O@ExecReload=$APPPATH/nzbget -O@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Modifying GROUP in SYSTEMD file failed.'$ENDCOLOR; exit 1; } - + sudo systemctl daemon-reload sudo systemctl enable $APPSYSTEMD diff --git a/plexmediaserver/plexmediaserver-constants.sh b/plexmediaserver/plexmediaserver-constants.sh index be50ccc..165285a 100755 --- a/plexmediaserver/plexmediaserver-constants.sh +++ b/plexmediaserver/plexmediaserver-constants.sh @@ -19,6 +19,6 @@ NEWPASS='atomic' # New password unencrypted APPNEWPASS='atomic' APPSYSTEMD='plexmediaserver.service' -APPSYSTEMDLOC="$SCRIPTPATH/plexmediaserver/plexmediaserver.service" +APPSYSTEMDLOC="$SCRIPTPATH/plexmediaserver/plexmediaserver.service" APPSYSTEMDOVERIDE="$SCRIPTPATH/plexmediaserver/plexmediaserver-override.conf" APPINITD='plexmediaserver' diff --git a/plexmediaserver/plexmediaserver-installer.sh b/plexmediaserver/plexmediaserver-installer.sh index 2352ba2..68c03be 100755 --- a/plexmediaserver/plexmediaserver-installer.sh +++ b/plexmediaserver/plexmediaserver-installer.sh @@ -20,7 +20,7 @@ source "$SCRIPTPATH/inc/app-repository-add.sh" source "$SCRIPTPATH/inc/pkgupdate.sh" source "$SCRIPTPATH/inc/app-folders-create.sh" -if IsSystemdSupported; then +if IsSystemdSupported; then # Setup the override first so it runs correctly first time. # Copies over a service file that will get overridden unless one isnt created. (Dev2day repo currently doesnt) source "$SCRIPTPATH/inc/app-autostart-configure.sh" diff --git a/qbittorrent-nox/qbittorrent-nox-installer.sh b/qbittorrent-nox/qbittorrent-nox-installer.sh index bb9fa27..b501bdb 100755 --- a/qbittorrent-nox/qbittorrent-nox-installer.sh +++ b/qbittorrent-nox/qbittorrent-nox-installer.sh @@ -26,7 +26,7 @@ echo sleep 1 source "$SCRIPTPATH/inc/app-autostart-configure.sh" -echo +echo sleep 1 source "$SCRIPTPATH/inc/app-folders-create.sh" diff --git a/qbittorrent-nox/qbittorrent-nox-settings-configurator.sh b/qbittorrent-nox/qbittorrent-nox-settings-configurator.sh index f954519..acc452a 100755 --- a/qbittorrent-nox/qbittorrent-nox-settings-configurator.sh +++ b/qbittorrent-nox/qbittorrent-nox-settings-configurator.sh @@ -4,8 +4,7 @@ # Publisher: http://www.htpcBeginner.com # License: MIT License (refer to README.md for more details) -# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING. -echo +echo echo -e "$YELLOW--->Configuring qBittorrent Settings...$ENDCOLOR" #Set username diff --git a/sabnzbdplus/sabnzbdplus-repository-configurator.sh b/sabnzbdplus/sabnzbdplus-repository-configurator.sh index 1ed5ae1..c5ee6cb 100755 --- a/sabnzbdplus/sabnzbdplus-repository-configurator.sh +++ b/sabnzbdplus/sabnzbdplus-repository-configurator.sh @@ -18,7 +18,7 @@ APPREPOSITORYLINK='deb http://ppa.launchpad.net/jcfp/ppa/ubuntu trusty main' REPOKEYSREQ='YES' elif [[ $CODENAME = 'stretch' ]]; then APPREPOSITORYLINK='deb http://ppa.launchpad.net/jcfp/ppa/ubuntu xenial main' - REPOKEYSREQ='YES' + REPOKEYSREQ='YES' else REPOPPA='YES' APPREPOSITORYLINK='ppa:jcfp/ppa' diff --git a/setup.sh b/setup.sh index e2044f8..35d4ceb 100755 --- a/setup.sh +++ b/setup.sh @@ -13,7 +13,7 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done export SCRIPTPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )" export ISSETUP="Yes" @@ -86,7 +86,7 @@ echo -e "${YELLOW}--->USER INFORMATION:$ENDCOLOR" if [[ ! -f $SCRIPTPATH/tmp/userinfo ]]; then #echo 'userinfo not present' source "$SCRIPTPATH/inc/usercheck.sh" -else +else #echo 'userinfo present' source "$SCRIPTPATH/tmp/userinfo" if [[ -z $UNAME ]] || [[ -z $UGROUP ]]; then diff --git a/subsonic/subsonic-download-install.sh b/subsonic/subsonic-download-install.sh index 695eaa9..aaf70ff 100755 --- a/subsonic/subsonic-download-install.sh +++ b/subsonic/subsonic-download-install.sh @@ -3,13 +3,10 @@ # Author: TommyE123 # Publisher: http://www.htpcBeginner.com # License: MIT License (refer to README.md for more details) -# - -# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING. cd $(mktemp -d) -FILE=$(curl -s http://www.subsonic.org/pages/download.jsp | grep -o '".*"' | grep -o 'subsonic.*\.deb' | sed 's/"//g' | head -1) +FILE=$(curl -s http://www.subsonic.org/pages/download.jsp | grep -o '".*"' | grep -o 'subsonic.*\.deb' | sed 's/"//g' | head -1) echo echo -e $YELLOW"File Found: ${FILE}"$ENDCOLOR URL="https://s3-eu-west-1.amazonaws.com/subsonic-public/download/${FILE}" diff --git a/syncthing/syncthing-init-update.sh b/syncthing/syncthing-init-update.sh index a5cf7cf..6f3034c 100755 --- a/syncthing/syncthing-init-update.sh +++ b/syncthing/syncthing-init-update.sh @@ -5,7 +5,7 @@ if [[ -f /etc/init.d/$APPINITD ]]; then echo "Updating $APPINITD file" - + sudo sed -i "s@REPLACEME@$UNAME@g" "/etc/init.d/$APPINITD" \ || { echo -e "${RED}Replacing daemon username in $APPINITD failed.$ENDCOLOR" ; exit 1; } fi diff --git a/utils/bash_aliases-installer.sh b/utils/bash_aliases-installer.sh index 856e29b..483490e 100755 --- a/utils/bash_aliases-installer.sh +++ b/utils/bash_aliases-installer.sh @@ -15,8 +15,7 @@ echo -e $GREEN'AtoMiC .bash_aliases Installer for HTPCs and Home Servers'$ENDCOL source "$SCRIPTPATH/inc/pause.sh" echo -e $YELLOW'--->Checking for .bashrc file...'$ENDCOLOR -if [ ! -f "/home/$UNAME/.bashrc" ]; -then +if [ ! -f "/home/$UNAME/.bashrc" ]; then echo -e $CYAN'/home/'$UNAME'/.bashrc'$ENDCOLOR' file not found. Creating it.' sudo cp /etc/skel/.bashrc /home/$UNAME/.bashrc || { echo -e $RED'Copying .bashrc failed.'$ENDCOLOR ; exit 1; } sudo chown $UNAME: /home/$UNAME/.bashrc @@ -28,8 +27,7 @@ echo sleep 1 echo -e $YELLOW'--->Checking for .profile file...'$ENDCOLOR -if [ ! -f "/home/$UNAME/.profile" ]; -then +if [ ! -f "/home/$UNAME/.profile" ]; then echo -e $CYAN'/home/'$UNAME'/.profile'$ENDCOLOR' file not found. Creating it.' sudo cp /etc/skel/.profile /home/$UNAME/.profile || { echo -e $RED'Copying .profile failed.'$ENDCOLOR ; exit 1; } sudo chown $UNAME: /home/$UNAME/.profile diff --git a/utils/mono/mono-repository-configurator.sh b/utils/mono/mono-repository-configurator.sh index 833703c..5a4f988 100755 --- a/utils/mono/mono-repository-configurator.sh +++ b/utils/mono/mono-repository-configurator.sh @@ -34,7 +34,7 @@ else ;; 'stretch') TEMPDIST='debian stretch' - ;; + ;; 'xenial'|'serena'|'sarah'|'sonya'|'sylvia'|'zesty'|'yakkety'|'artful') TEMPDIST='ubuntu xenial' ;; diff --git a/utils/nginx/nginx-repository-configurator.sh b/utils/nginx/nginx-repository-configurator.sh index 8251f35..83110bb 100755 --- a/utils/nginx/nginx-repository-configurator.sh +++ b/utils/nginx/nginx-repository-configurator.sh @@ -10,10 +10,10 @@ CODENAME=$(lsb_release -c -s) case "$CODENAME" in - 'squeeze'|'wheezy'|'jessie'|'stretch') + 'squeeze'|'wheezy'|'jessie'|'stretch') DIST='debian' ;; - 'lucid' | 'oneiric' | 'precise' | 'quantal' | 'raring' | 'saucy' | 'trusty' | 'utopic' | 'vivid' | 'wily' | 'xenial' | 'yakkety' |'zesty') + 'lucid' | 'oneiric' | 'precise' | 'quantal' | 'raring' | 'saucy' | 'trusty' | 'utopic' | 'vivid' | 'wily' | 'xenial' | 'yakkety' |'zesty') DIST='ubuntu' ;; 'sonya' | 'serena' | 'sarah'| 'sylvia') @@ -23,7 +23,7 @@ CODENAME=$(lsb_release -c -s) 'rosa' | 'rafaela' | 'rebecca' | 'qiana') DIST='ubuntu' CODENAME='trusty' - ;; + ;; 'betsy') DIST='debian' CODENAME='jessie' diff --git a/utils/nginx/nginx-site-configurator.sh b/utils/nginx/nginx-site-configurator.sh index 7066840..d0f6431 100755 --- a/utils/nginx/nginx-site-configurator.sh +++ b/utils/nginx/nginx-site-configurator.sh @@ -35,7 +35,7 @@ fi #COpy over the previous nginx.conf so we get the default settings for the hardware\distro. cat "$SCRIPTPATH/utils/nginx/nginx.conf" > /etc/nginx/nginx.conf || \ { echo -e "${RED}Could not update nginx.conf file.$ENDCOLOR" ; exit 1; } -echo "Updated nginx.conf file with previous version" +echo "Updated nginx.conf file with previous version" source "$SCRIPTPATH/inc/app-start.sh" sudo nginx -s reload diff --git a/utils/nodejs/nodejs-constants.sh b/utils/nodejs/nodejs-constants.sh index 30b13d7..7b8d83b 100755 --- a/utils/nodejs/nodejs-constants.sh +++ b/utils/nodejs/nodejs-constants.sh @@ -4,5 +4,5 @@ APPTITLE='Node.js' APPNAME='nodejs' APPREPOSITORYNAME='nodesource' REPRECVKEYSHORT='68576280' -APPREPOSITORYLINK='https://deb.nodesource.com' +APPREPOSITORYLINK='https://deb.nodesource.com' #APPREPOSITORYLINK value is only needed to get it through remove diff --git a/utils/nodejs/nodejs-menu.sh b/utils/nodejs/nodejs-menu.sh index 720deef..e15d8eb 100755 --- a/utils/nodejs/nodejs-menu.sh +++ b/utils/nodejs/nodejs-menu.sh @@ -18,7 +18,7 @@ if [[ $exitstatus = 0 ]]; then source "$SCRIPTPATH/utils/nodejs/nodejs-uninstaller.sh" ;; "Go Back" ) source "$SCRIPTPATH/utils/utils-menu.sh" ;; - *) + *) source "$SCRIPTPATH/inc/invalid-option.sh" ;; esac else diff --git a/utils/php/php-menu.sh b/utils/php/php-menu.sh index 7ec38dc..c56a85e 100755 --- a/utils/php/php-menu.sh +++ b/utils/php/php-menu.sh @@ -15,7 +15,7 @@ if [[ $exitstatus = 0 ]]; then source "$SCRIPTPATH/utils/php/php-installer.sh" ;; "Go Back" ) source "$SCRIPTPATH/utils/utils-menu.sh" ;; - *) + *) source "$SCRIPTPATH/inc/invalid-option.sh" ;; esac else diff --git a/utils/rvm/rvm-installer.sh b/utils/rvm/rvm-installer.sh index bc269d7..481c310 100755 --- a/utils/rvm/rvm-installer.sh +++ b/utils/rvm/rvm-installer.sh @@ -16,7 +16,7 @@ source /home/$UNAME/.rvm/scripts/rvm if [[ -f .bashrc ]]; then echo "Set Ruby to use default version in .bashrc file" - grep -q -F '[[ -s "/home/$UNAME/.rvm/scripts/rvm" ]] && source "/home/$UNAME/.rvm/scripts/rvm"' .bashrc || + grep -q -F '[[ -s "/home/$UNAME/.rvm/scripts/rvm" ]] && source "/home/$UNAME/.rvm/scripts/rvm"' .bashrc || echo '[[ -s "/home/$UNAME/.rvm/scripts/rvm" ]] && source "/home/$UNAME/.rvm/scripts/rvm"' >> .bashrc fi diff --git a/utils/rvm/rvm-menu.sh b/utils/rvm/rvm-menu.sh index 586be61..62c3d31 100755 --- a/utils/rvm/rvm-menu.sh +++ b/utils/rvm/rvm-menu.sh @@ -18,7 +18,7 @@ if [[ $exitstatus = 0 ]]; then source "$SCRIPTPATH/utils/$APPNAME/$APPNAME-uninstaller.sh" ;; "Go Back" ) source "$SCRIPTPATH/utils/utils-menu.sh" ;; - *) + *) source "$SCRIPTPATH/inc/invalid-option.sh" ;; esac else diff --git a/utils/utils-menu.sh b/utils/utils-menu.sh index b821bc7..fba9e00 100755 --- a/utils/utils-menu.sh +++ b/utils/utils-menu.sh @@ -38,7 +38,7 @@ if [[ $exitstatus = 0 ]]; then "Nginx" ) source "$SCRIPTPATH/utils/nginx/nginx-menu.sh" ;; "Node.js" ) - source "$SCRIPTPATH/utils/nodejs/nodejs-menu.sh" ;; + source "$SCRIPTPATH/utils/nodejs/nodejs-menu.sh" ;; "nzbToMedia" ) source "$SCRIPTPATH/utils/nzbtomedia/nzbtomedia-menu.sh" ;; "OpenVPN" )