| 1 | 10 | simandl | #!/usr/bin/env sh |
| 2 | | | |
| 3 | | | if ! [ -e settings ]; then OUTFILE="settings"; else OUTFILE="settings.new"; fi |
| 4 | | | |
| 5 | | | cat > $OUTFILE << EOF |
| 6 | | | # define path to the apc access tool including the cmdline option |
| 7 | | | # to retrieve the status protocol |
| 8 | | | # |
| 9 | | | # Example: |
| 10 | | | # APCACCESS=/usr/local/bin/apcaccess status |
| 11 | | | # |
| 12 | | | EOF |
| 13 | | | |
| 14 | | | if [ "$OUTFILE" = "settings.new" ]; then |
| 15 | | | cat settings | grep "^APCACCESS=" >> $OUTFILE |
| 16 | | | fi |
| 17 | | | |
| 18 | | | echo |
| 19 | | | echo "Please check the settings file and adapt it to satisfy your needs." |
| 20 | | | if [ "$OUTFILE" = "settings.new" ]; then |
| 21 | | | mkdir -p backup |
| 22 | | | NOW=`date +%Y%m%d-%H%M%S` |
| 23 | | | mv -f settings backup/settings-$NOW |
| 24 | | | mv -f settings.new settings |
| 25 | | | echo "a backup of the previous settings has been saved." |
| 26 | | | fi |
| 27 | | | echo |
| 28 | | | |