File: hostname.test

package info (click to toggle)
oldsys-preseed 3.24
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 532 kB
  • sloc: xml: 438; sh: 304; makefile: 4
file content (23 lines) | stat: -rwxr-xr-x 446 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

tmp="$1"

check_hostname() {
	if ! verify_hostname "$1"; then
		echo "Invalid name $1" >> $tmp
	else
		echo "Valid name $1" >> $tmp
	fi
}

check_hostname "test123"
check_hostname "123test"
check_hostname "123-123"
check_hostname "TEST123"
check_hostname "te_st"
check_hostname "-test"
check_hostname "test-"
check_hostname "a"
check_hostname "axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
check_hostname "foo bar"