Using this command, a deployscript is executed as root , but the ./tmp/cp1.shscript is launched by the current shell under your current privileges. To avoid this, you can prefix sudo for both:
sudo /usr/local/sbin/deploy | sudo ./tmp/cp1.sh
Or you can create a shell from sudo, so the shell is already running as root:
sudo sh -c '/usr/local/sbin/deploy | ./tmp/cp1.sh'
intgr source
share