diff options
author | Xotic750 <xotic750@gmail.com> | 2016-05-31 17:54:13 +0200 |
---|---|---|
committer | Xotic750 <xotic750@gmail.com> | 2016-06-03 14:56:02 +0200 |
commit | 00c5191e3c4253c67bc91d46949fea4680bb59b5 (patch) | |
tree | 99d6c6b5cfdb12a4e254a02ed79e8fbc23f8052f /net/znc/files | |
parent | dd31bada67cb30d127fd61f888bb897dd3858bc9 (diff) |
znc: Added RUNAS_SHELL variable to assist when using external configuration
Signed-off-by: Graham Fairweather <xotic750@gmail.com>
Diffstat (limited to 'net/znc/files')
-rw-r--r-- | net/znc/files/znc.init | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/znc/files/znc.init b/net/znc/files/znc.init index 2ee5a1e58..91f3ecaa7 100644 --- a/net/znc/files/znc.init +++ b/net/znc/files/znc.init @@ -12,6 +12,7 @@ DISABLED= RUNAS_USER= RUNAS_GROUP= +RUNAS_SHELL= add_param() { echo "$1 = $2" >> $ZNC_CONFIG @@ -60,6 +61,7 @@ znc_global() { config_get RUNAS_USER "$znc" runas_user config_get RUNAS_GROUP "$znc" runas_group + config_get RUNAS_SHELL "$znc" runas_shell if [ "${znc_config_path}" ] then @@ -168,7 +170,7 @@ start() { config_foreach add_listener listener config_foreach add_user user - chown -hR ${RUNAS_USER:-nobody}:${RUNAS_GROUP:-nogroup} /tmp/etc/znc + chown -hR ${RUNAS_USER:-nobody}:${RUNAS_GROUP:-nogroup} ${ZNC_CONFIG_PATH} fi if [ "$EXTERNAL_CONFIG" -eq 1 -a "$RUNAS_USER" ] @@ -176,7 +178,8 @@ start() { local SU=$(which su) if [ "$SU" ] then - $SU -c "/usr/bin/znc -d$ZNC_CONFIG_PATH >/dev/null &" $RUNAS_USER + chown -hR ${RUNAS_USER:-nobody}:${RUNAS_GROUP:-nogroup} ${ZNC_CONFIG_PATH} + $SU ${RUNAS_SHELL:+s $RUNAS_SHELL} -c "/usr/bin/znc -d$ZNC_CONFIG_PATH >/dev/null &" $RUNAS_USER else logger -s -t ZNC -p daemon.err "Could not run ZNC as user $RUNAS_USER: su not found." exit 1 |