Skip to content

Instantly share code, notes, and snippets.

@hakandilek
Created April 18, 2015 08:11
Show Gist options
  • Save hakandilek/0fe6c72d7cfc8f51bbd1 to your computer and use it in GitHub Desktop.
Save hakandilek/0fe6c72d7cfc8f51bbd1 to your computer and use it in GitHub Desktop.
synology optware.sh
#!/bin/sh
#
# Optware setup
# Alternatives Optware Startup und Shutdown Script #/usr/local/etc/rc.d/optware.sh
#
case $1 in
start)
[ ! -h /opt -a ! -d /opt ] && ln -s /volume1/@optware /opt
for i in /opt/etc/init.d/S??* ;do
#
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
#
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done
;;
#
stop)
#
for i in /opt/etc/init.d/S??* ;do
#
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
#
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set stop
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i stop ;;
esac
done
;;
#
*)
echo "Usage: $0 [start|stop]"
;;
esac
#
# End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment