Skip to content

Commit

Permalink
Fix space in time interval.
Browse files Browse the repository at this point in the history
  • Loading branch information
coppit committed Aug 23, 2015
1 parent 872c58e commit eb88d80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion noip.conf
Expand Up @@ -7,4 +7,4 @@ PASSWORD='your password here'
DOMAINS='foo.ddns.net'

# Examples: 5 m, 5 h, 5 d. Minimum is 5 minutes.
INTERVAL='30 m'
INTERVAL='30m'
6 changes: 3 additions & 3 deletions noip.sh
Expand Up @@ -36,12 +36,12 @@ elif [ "$PASSWORD" = "your password here" ]; then
exit 1
fi

if [[ ! "$INTERVAL" =~ ^[0-9]+\ [mhd]$ ]]; then
echo "INTERVAL must be a number followed by m, h, or d. Example: 5 m"
if [[ ! "$INTERVAL" =~ ^[0-9]+[mhd]$ ]]; then
echo "INTERVAL must be a number followed by m, h, or d. Example: 5m"
exit 1
fi

if [[ $(echo $INTERVAL | awk '{print $2}') == 'm' && $(echo $INTERVAL | awk '{print $1}') -lt 5 ]]; then
if [[ "${INTERVAL: -1}" == 'm' && "${INTERVAL:0:-1}" -lt 5 ]]; then
echo "The shortest allowed INTERVAL is 5 minutes"
exit 1
fi
Expand Down

0 comments on commit eb88d80

Please sign in to comment.