summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2018-07-23 17:19:18 +0100
committerRoss Burton <ross.burton@intel.com>2018-07-23 18:05:31 +0100
commit8a72dd75db9949f3175600f101e4bc1ffac076de (patch)
tree1aa72447496741e92c1fab8acdf1c68e44885b47
parenteca680ddf28d024954895f59a241a622dd575c11 (diff)
downloadupdate-rc.d-8a72dd75db9949f3175600f101e4bc1ffac076de.tar.gz
update-rc.d-8a72dd75db9949f3175600f101e4bc1ffac076de.tar.bz2
update-rc.d-8a72dd75db9949f3175600f101e4bc1ffac076de.zip
Add verbose toggle (default to off)
-rw-r--r--update-rc.d10
1 files changed, 8 insertions, 2 deletions
diff --git a/update-rc.d b/update-rc.d
index ec50d15..5e32902 100644
--- a/update-rc.d
+++ b/update-rc.d
@@ -19,6 +19,7 @@ etcd="/etc/rc"
notreally=0
force=0
dostart=0
+verbose=0
usage()
{
@@ -28,6 +29,7 @@ usage: update-rc.d [-n] [-f] [-r <root>] <basename> remove
update-rc.d [-n] [-r <root>] [-s] <basename> start|stop NN runlvl [runlvl] [...] .
-n: not really
-f: force
+ -v: verbose
-r: alternate root path (default is /)
-s: invoke start methods if appropriate to current runlevel
EOF
@@ -69,7 +71,7 @@ dolink()
lev=`echo $2 | cut -d/ -f1`
nn=`echo $2 | cut -d/ -f2`
fn="${etcd}${lev}.d/${startstop}${nn}${bn}"
- echo " $fn -> ../init.d/$bn"
+ [ $verbose -eq 1 ] && echo " $fn -> ../init.d/$bn"
if [ $notreally -eq 0 ]; then
mkdir -p `dirname $fn`
ln -s ../init.d/$bn $fn
@@ -89,7 +91,7 @@ makelinks()
exit 0
fi
- echo " Adding system startup for $initd/$bn ..."
+ echo " Adding system startup for $initd/$bn."
for i in $startlinks; do
dolink S $i
@@ -105,6 +107,10 @@ while [ $# -gt 0 ]; do
shift
continue
;;
+ -v) verbose=1
+ shift
+ continue
+ ;;
-f) force=1
shift
continue