Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Trouble making init.d script on Fedora 26

I have been trying to get my script to run on boot but it won't, I have made the file executable. What am I doing wrong? Here is the code.

#!/bin/bash
# Shadowsocksserver Shadows socks server
# chkconfig: 2345 99 01
# description: This script autostarts my Shadow Socks server
# processname: 1834
. /etc/init.d/functions
start() {
     sudo ssserver -c /etc/shadowsocks.json -d start

}

stop() {
    sudo ssserver -c /etc/shadowsocks.json -d stop
}

case "$1" in
start)
stop)
status)
restart)
*)
esac

This is my first time trying to make a init.d script. The script is meant to start my shadow socks proxy.