slitaz-base-files rev 241

Add sudo wrapper
author Christophe Lincoln <pankso@slitaz.org>
date Fri Apr 25 03:42:56 2014 +0200 (2014-04-25)
parents a04fbd11b6e7
children 151ef5764f97
files rootfs/etc/sysctl.conf rootfs/usr/bin/sudo
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/rootfs/etc/sysctl.conf	Fri Apr 25 03:42:56 2014 +0200
     1.3 @@ -0,0 +1,2 @@
     1.4 +# /etc/sysctl.conf: Kernel sysctl configuration file for Linux
     1.5 +#
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/rootfs/usr/bin/sudo	Fri Apr 25 03:42:56 2014 +0200
     2.3 @@ -0,0 +1,17 @@
     2.4 +#!/bin/sh
     2.5 +#
     2.6 +# Sudo wrapper using Busybox su applet.
     2.7 +# Copyright (C) 2014 SliTaz GNU/Linux.
     2.8 +#
     2.9 +
    2.10 +cmd="$@"
    2.11 +pwd="$(pwd)"
    2.12 +
    2.13 +case "$1" in
    2.14 +	usage|*help|"")
    2.15 +		echo -e "\nExecute a command as root"
    2.16 +		echo -e "Usage: $(basename $0) [command]\n" ;;
    2.17 +	*)
    2.18 +		su -c "cd $pwd; $cmd"
    2.19 +esac
    2.20 +exit 0