i have a short bash script which can run a file. When im trying to start this by "x.sh start", there is appearing a warning 'must be connected to a terminal'. How to start this? I tried some configs of chmods. This script is in /usr/local/bin Im now on root, on my Debian 7 vps.
#!/bin/bash
server_start() {
screen /usr/share/s/x.sh &
}
server_stop() {
killall x.sh
killall xx
}
server_restart() {
server_stop
sleep 1
server_start
}
case "$1" in
'start')
server_start
;;
'stop')
server_stop
;;
'restart')
server_restart
;;
*)
echo "usage $0 start|stop|restart"
esac