Created
April 18, 2015 08:11
-
-
Save hakandilek/0fe6c72d7cfc8f51bbd1 to your computer and use it in GitHub Desktop.
synology optware.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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