- Timestamp:
- May 19, 2012, 4:31:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-9.0/nanobsd/files/tools/wl-config
r10827 r10917 45 45 STARTUP_LOC="/cfg/local/${FILE}" 46 46 RUNNING_LOC="/usr/local/etc/${FILE}" 47 FILE_HINT="service isc-dhcpd restart"47 POST_CMD="service isc-dhcpd restart" 48 48 ;; 49 49 'dnsmasq.conf') 50 50 STARTUP_LOC="/cfg/local/${FILE}" 51 51 RUNNING_LOC="/usr/local/etc/${FILE}" 52 FILE_HINT="service dnsmasq restart"52 POST_CMD="service dnsmasq restart" 53 53 ;; 54 54 'motd') … … 60 60 STARTUP_LOC="/cfg/namedb/${FILE}" 61 61 RUNNING_LOC="/etc/namedb/${FILE}" 62 FILE_HINT="service named restart"62 POST_CMD="service named restart" 63 63 ;; 64 64 'rc.conf.local') 65 65 STARTUP_LOC="/cfg/${FILE}" 66 66 RUNNING_LOC="/etc/${FILE}" 67 FILE_HINT=" service netif restart"67 FILE_HINT="Restart interfaces with: nohup service netif restart" 68 68 ;; 69 69 'resolv.conf') 70 70 STARTUP_LOC="/cfg/${FILE}" 71 71 RUNNING_LOC="/etc/${FILE}" 72 FILE_HINT="To get the ordering right run: nameserver-shuffle" 72 73 ;; 73 74 'pf.hybrid.conf.local') … … 85 86 usage() { 86 87 ( 87 echo "Usage: $0 [-b n] [-c <config>] [-m <all|startup|testing|running>]"88 echo "Usage: $0 [-bpn] [-c <config>] [-m <all|startup|testing|running>]" 88 89 echo " -b = batch mode, no user input" 89 90 echo " -c <config> = default configuration to fetch" 90 echo " -d = do not run the POST_CMD commands" 91 echo " -d = do not run the POST_CMD commands [default]" 92 echo " -p = run the POST_CMD commands to activate the services right-away" 91 93 echo " -n = do not mount config partition" 92 94 echo " -m all = copy config files to running & config partition [default]" … … 106 108 OPT_HACK=0 # Hack for people without configuration managment and testing 107 109 OPT_BATCH=0 108 OPT_POSTCMD= true110 OPT_POSTCMD=false 109 111 110 112 parse_options() { 111 while getopts "bc:nm:d " OPT; do113 while getopts "bc:nm:dp" OPT; do 112 114 case "$OPT" in 113 115 b) OPT_BATCH=1;; … … 124 126 esac;; 125 127 h) usage;; 128 p) OPT_POSTCMD=true;; 126 129 \?) usage;; 127 130 esac … … 143 146 echo "# WARN: Copy running configuration to startup configuration" 144 147 echo "# WARN: Please do mind to document/mention this changes somewhere" 148 fi 149 150 if /bin/df / | grep -q "^/dev/md[0-9]"; then 151 OPT_MOUNT=0 152 echo "# WARN: Mount operations disabled as we are running in a md(4) image" 145 153 fi 146 154 … … 264 272 if [ $? -eq 0 ]; then 265 273 echo "# INFO: '${FILE}' changed" 266 if $OPT_POSTCMD && [ -n "${POST_CMD}" ]; then 267 echo "## Running post_cmd: $POST_CMD" 268 $POST_CMD 274 if [ -n "${POST_CMD}" ]; then 275 if $OPT_POSTCMD; then 276 echo "## Running post_cmd: $POST_CMD" 277 $POST_CMD 278 else 279 echo "## To activate run the post_cmd: $POST_CMD" 280 fi 269 281 fi 270 282 if [ -n "${FILE_HINT}" ]; then 271 echo "# INFO: For instant activate:${FILE_HINT}"283 echo "# INFO: ${FILE_HINT}" 272 284 echo "" 273 285 fi
Note:
See TracChangeset
for help on using the changeset viewer.