Add ssc338q_apfpv_greg-generic-cu-eu profile
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting network..."
|
||||
ifup lo
|
||||
ifup eth0
|
||||
ifup wlan0
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo "Stopping network..."
|
||||
ifdown lo
|
||||
ifdown -f eth0
|
||||
ifdown -f wlan0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/init.d/libmedia.sh
|
||||
|
||||
DAEMON="/usr/bin/majestic"
|
||||
NAME="majestic"
|
||||
PIDFILE="/var/run/majestic.pid"
|
||||
|
||||
start() {
|
||||
echo "Starting $NAME..."
|
||||
if ensure_pidfile "$NAME" "$PIDFILE"; then
|
||||
echo "$NAME is already running"
|
||||
return 0
|
||||
fi
|
||||
|
||||
rm -f "$PIDFILE"
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON" -- -s
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to launch $NAME"
|
||||
return 1
|
||||
fi
|
||||
echo "$NAME launch requested"
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Stopping $NAME..."
|
||||
stop_service "$NAME" "$PIDFILE" 15 || return 1
|
||||
# Majestic keeps internal single-instance state briefly after exit.
|
||||
sleep 2
|
||||
}
|
||||
|
||||
status() {
|
||||
if ensure_pidfile "$NAME" "$PIDFILE"; then
|
||||
echo "$NAME running pid=$(cat "$PIDFILE")"
|
||||
return 0
|
||||
fi
|
||||
echo "$NAME stopped"
|
||||
return 1
|
||||
}
|
||||
|
||||
reload() {
|
||||
ensure_pidfile "$NAME" "$PIDFILE" || {
|
||||
echo "$NAME not running"
|
||||
return 1
|
||||
}
|
||||
kill -HUP "$(cat "$PIDFILE")"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload|status)
|
||||
"$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
MAJESTIC_API="http://localhost/api/v1/config.json"
|
||||
|
||||
wait_for_majestic_ready() {
|
||||
timeout="${1:-30}"
|
||||
i=0
|
||||
while [ "$i" -lt "$timeout" ]; do
|
||||
curl -sf --connect-timeout 1 --max-time 2 "$MAJESTIC_API" >/dev/null 2>&1 && return 0
|
||||
sleep 1
|
||||
i=$((i + 1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
start() {
|
||||
echo "S99rc.local: waiting for majestic API..."
|
||||
if ! wait_for_majestic_ready 10; then
|
||||
echo "S99rc.local: majestic API not ready after 10s; continuing with /etc/rc.local anyway"
|
||||
else
|
||||
echo "S99rc.local: majestic API ready"
|
||||
fi
|
||||
echo "S99rc.local: running /etc/rc.local"
|
||||
/etc/rc.local
|
||||
}
|
||||
|
||||
stop() {
|
||||
[ -x /etc/rc.local.stop ] && /etc/rc.local.stop
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop)
|
||||
"$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $?
|
||||
Reference in New Issue
Block a user