-
-
Save lucndm/d4eef482128c13d759807329a917a3ac to your computer and use it in GitHub Desktop.
Revisions
-
hjbotha revised this gist
Jul 25, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ #! /bin/bash # NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION # Developed for DSM 6. Not tested on other versions. # Steps to install # Save this script in one of your shares # Backup /usr/syno/share/nginx/ as follows: -
hjbotha revised this gist
Feb 6, 2021 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,12 +19,13 @@ BACKUP_FILES=true # change to false to disable backups BACKUP_DIR=/volume1/apps/free_ports/backup DELETE_OLD_BACKUPS=false # change to true to automatically delete old backups. KEEP_BACKUP_DAYS=30 CURRENT_BACKUP_DIR="$BACKUP_DIR/$DATE" DATE=$(date +%Y-%m-%d-%H-%M-%S) if [ "$BACKUP_FILES" == "true" ]; then mkdir -p "$CURRENT_BACKUP_DIR" cp /usr/syno/share/nginx/*.mustache "$CURRENT_BACKUP_DIR" fi if [ "$DELETE_OLD_BACKUPS" == "true" ]; then @@ -33,3 +34,7 @@ fi sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)80\([^0-9]\)/\1$HTTP_PORT\2/" /usr/syno/share/nginx/*.mustache sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)443\([^0-9]\)/\1$HTTPS_PORT\2/" /usr/syno/share/nginx/*.mustache echo "Made these changes:" diff /usr/syno/share/nginx/ $CURRENT_BACKUP_DIR 2>&1 | tee $CURRENT_BACKUP_DIR/changes.log -
hjbotha revised this gist
Dec 6, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,9 +15,9 @@ HTTP_PORT=81 HTTPS_PORT=444 BACKUP_FILES=true # change to false to disable backups BACKUP_DIR=/volume1/apps/free_ports/backup DELETE_OLD_BACKUPS=false # change to true to automatically delete old backups. KEEP_BACKUP_DAYS=30 DATE=$(date +%Y-%m-%d-%H-%M-%S) -
hjbotha revised this gist
Dec 6, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ BACKUP_DIR=/volume1/apps/free_ports/backup DELETE_OLD_BACKUPS=false KEEP_BACKUP_DAYS=30 DATE=$(date +%Y-%m-%d-%H-%M-%S) if [ "$BACKUP_FILES" == "true" ]; then mkdir -p "$BACKUP_DIR/$DATE" -
hjbotha revised this gist
Aug 4, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ if [ "$BACKUP_FILES" == "true" ]; then fi if [ "$DELETE_OLD_BACKUPS" == "true" ]; then find "$BACKUP_DIR/" -type d -mtime +$KEEP_BACKUP_DAYS -exec rm -r {} \; fi sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)80\([^0-9]\)/\1$HTTP_PORT\2/" /usr/syno/share/nginx/*.mustache -
hjbotha revised this gist
Jun 2, 2020 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ #! /bin/bash # NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION # Steps to install # Save this script in one of your shares # Backup /usr/syno/share/nginx/ as follows: @@ -14,5 +15,21 @@ HTTP_PORT=81 HTTPS_PORT=444 BACKUP_FILES=false BACKUP_DIR=/volume1/apps/free_ports/backup DELETE_OLD_BACKUPS=false KEEP_BACKUP_DAYS=30 DATE=$(date +%Y-%m-%d-%H-%m-%S) if [ "$BACKUP_FILES" == "true" ]; then mkdir -p "$BACKUP_DIR/$DATE" cp /usr/syno/share/nginx/*.mustache "$BACKUP_DIR/$DATE" fi if [ "$DELETE_OLD_BACKUPS" == "true" ]; then find "/volume1/apps/traefik/backup_free_ports/" -type d -mtime +$KEEP_BACKUP_DAYS -exec rm -r {} \; fi sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)80\([^0-9]\)/\1$HTTP_PORT\2/" /usr/syno/share/nginx/*.mustache sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)443\([^0-9]\)/\1$HTTPS_PORT\2/" /usr/syno/share/nginx/*.mustache -
hjbotha revised this gist
Jul 18, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,5 +14,5 @@ HTTP_PORT=81 HTTPS_PORT=444 sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)80\([^0-9]\)/\1$HTTP_PORT\2/" /usr/syno/share/nginx/*.mustache sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)443\([^0-9]\)/\1$HTTPS_PORT\2/" /usr/syno/share/nginx/*.mustache -
hjbotha revised this gist
Jul 18, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,5 +14,5 @@ HTTP_PORT=81 HTTPS_PORT=444 sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)80\([^0-9]\)/\1$HTTP_PORT1\2/" /usr/syno/share/nginx/*.mustache sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)443\([^0-9]\)/\1$HTTPS_PORT\2/" /usr/syno/share/nginx/*.mustache -
hjbotha revised this gist
Jul 18, 2019 . 1 changed file with 11 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,18 @@ #! /bin/bash # Steps to install # Save this script in one of your shares # Backup /usr/syno/share/nginx/ as follows: # # cd /usr/syno/share/ # # tar cvf ~/nginx.tar nginx # Run this script as root # Reboot and ensure everything is still working # If not, restore the backup and post a comment on this script's gist page # If it did, schedule it to run at boot # through Control Panel -> Task Scheduler HTTP_PORT=81 HTTPS_PORT=444 sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)80\([^0-9]\)/\181\2/" /usr/syno/share/nginx/*.mustache sed -i "s/^\([ \t]\+listen[ \t]\+[]:[]*\)443\([^0-9]\)/\1444\2/" /usr/syno/share/nginx/*.mustache -
hjbotha revised this gist
Apr 5, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,5 +9,5 @@ HTTP_PORT=81 HTTPS_PORT=444 sed -i "s/^\( *listen .*\)80/\1$HTTP_PORT/" /usr/syno/share/nginx/*.mustache sed -i "s/^\( *listen .*\)443/\1$HTTPS_PORT/" /usr/syno/share/nginx/*.mustache -
hjbotha revised this gist
Mar 22, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ #! /bin/bash # Save this script in one of your shares and schedule it to run as root at boot # through Control Panel -> Task Scheduler # DSM upgrades will reset these changes, which is why we schedule them to happen automatically # Set the variables below if you want to customise the ports which DSM will listen on instead # NOTE: These ports are used for some services, e.g. Photo Station -
hjbotha revised this gist
Mar 22, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ # Save this script in one of your shares and schedule it to run at boot # through Control Panel -> Task Scheduler # Set the variables below if you want to customise the ports which DSM will listen on instead # NOTE: These ports are used for some services, e.g. Photo Station HTTP_PORT=81 HTTPS_PORT=444 -
hjbotha created this gist
Mar 22, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ #! /bin/bash # Save this script in one of your shares and schedule it to run at boot # through Control Panel -> Task Scheduler HTTP_PORT=81 HTTPS_PORT=444 sed -i 's/^\( *listen .*\)80/\1$HTTP_PORT/' /usr/syno/share/nginx/*.mustache sed -i 's/^\( *listen .*\)443/\1$HTTPS_PORT/' /usr/syno/share/nginx/*.mustache