-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6 - Support Unix OS - use socat and su
- Loading branch information
Nikolay.Pianikov
authored and
Nikolay.Pianikov
committed
Nov 23, 2016
1 parent
3604d3b
commit 831ed3c
Showing
6 changed files
with
15 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,7 @@ | ||
#!/bin/bash | ||
|
||
echo param1=$1 | ||
echo param2=$2 | ||
echo param3=$3 | ||
|
||
args=$(cat "$1") | ||
command=$2 | ||
password=$3 | ||
|
||
echo args=$args | ||
echo command=$command | ||
echo password=$password | ||
|
||
echo -e "$password\n" | sudo --preserve-env --set-home --stdin $args $command | ||
#sudo --preserve-env -set-home --stdin $args #scommand | ||
(sleep .3; echo "$password") | socat - EXEC:'su -c $command $args',pty,ctty,setsid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters