slitaz-base-files view rootfs/usr/bin/sudo @ rev 341

Remove cat process
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Oct 20 12:11:12 2019 +0200 (2019-10-20)
parents 71f423a331df
children
line source
1 #!/bin/sh
2 #
3 # Sudo wrapper using Busybox su applet.
4 # Copyright (C) 2014 SliTaz GNU/Linux.
5 #
7 cmd="$@"
8 pwd="$(pwd)"
9 conf="${XDG_CONFIG_HOME:-$HOME/.config}/slitaz/subox.conf"
11 case "$1" in
12 usage|*help|"")
13 echo -e "\nExecute a command as root"
14 echo -e "Usage: $(basename $0) [command]\n" ;;
15 *)
16 if [ -s "$conf" ]; then
17 # Saved root password
18 su -c "cd $pwd; $cmd" < "$conf"
19 else
20 su -c "cd $pwd; $cmd"
21 fi ;;
22 esac
23 exit 0