chiark / gitweb /
client: New options for setting user and group identities.
[tripe] / init / tripe-init.in
index e609a653af0a1765e5c1badef08ff6c0e08b646e..dfa7e0319b818c31e10c20f104e09b39a01e2db6 100755 (executable)
@@ -10,11 +10,11 @@ set -e
 [ -f @initconfig@ ] && . @initconfig@
 : ${prefix=@prefix@} ${exec_prefix=@exec_prefix@}
 : ${bindir=@bindir@} ${sbindir=@sbindir@}
-: ${TRIPEDIR=@configdir@} ${tripesock=@socketdir@/tripesock}
+: ${TRIPEDIR=@configdir@} ${TRIPESOCK=@socketdir@/tripesock}
 : ${pidfile=@pidfile@}
 : ${tripe=$sbindir/tripe} ${tripectl=$bindir/tripectl}
 PATH=/usr/bin:/usr/sbin:/bin:/sbin:$bindir
-export PATH TRIPEDIR
+export PATH TRIPEDIR TRIPESOCK
 
 # --- Give up if there's no key ---
 
@@ -33,7 +33,7 @@ case ${tunnel-`$tripe --tunnels | head -1`} in
   linux)
     case `uname -s` in
       Linux)
-       if { test -f /proc/misc && grep -q net/tun /proc/misc; } ||
+       if { test -f /proc/misc && grep -q tun /proc/misc; } ||
           modprobe -q tun; then
          : good
        else
@@ -106,7 +106,7 @@ case ${tunnel-`$tripe --tunnels | head -1`} in
     fi
     ;;
 esac
-  
+
 # --- Do what was wanted ---
 
 case "$1" in
@@ -122,8 +122,8 @@ case "$1" in
       ${keytag+-S-t}$keytag \
       ${addr+-S-b}$addr \
       ${port+-S-p}${port} \
-      ${user+-S-u}${user} \
-      ${group+-S-g}${group} \
+      ${user+-U}${user} \
+      ${group+-G}${group} \
       ${trace+-S-T}${trace} \
       ${tunnel+-S-n}${tunnel} \
       ${miscopts}
@@ -140,23 +140,23 @@ case "$1" in
       [ -x $i ] || continue
       name=`basename $i`
       case $name in *~|\#*) continue;; esac
-      if $i; then 
+      if $i; then
        echo -n " $name"
       else
-        echo -n " ($name failed)"
+       echo -n " ($name failed)"
       fi
     done
     echo " done"
     ;;
   stop)
     echo -n "Stopping TrIPE VPN daemon:"
-    if test ! -S $tripesock; then
+    if test ! -S $TRIPESOCK; then
       echo " not running"
     elif $tripectl quit >/dev/null 2>&1; then
       echo " done"
     elif test ! -f $pidfile; then
       echo " stale socket found: removing"
-      rm -f $tripesock
+      rm -f $TRIPESOCK
     elif kill `cat $pidfile`; then
       echo " done (killed violently)"
     else