[arch-general] [PATCH] restrict NETWORK_PERSIST to runlevel 0 and 6
Signed-off-by: Florian Pritz <bluewind@xssn.at> --- network | 2 +- rc.shutdown | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/network b/network index 977e81e..d1ecdde 100755 --- a/network +++ b/network @@ -233,7 +233,7 @@ case "$1" in # exit #fi - if [ "${NETWORK_PERSIST}" = "yes" -o "${NETWORK_PERSIST}" = "YES" ]; then + if [ "${NETWORK_PERSIST}" = "yes" -o "${NETWORK_PERSIST}" = "YES" ] && [[ $RUNLEVEL = 0 || $RUNLEVEL = 6 ]] ; then status "Skipping Network Shutdown" true exit 0 fi diff --git a/rc.shutdown b/rc.shutdown index 4eb29cc..bbd4444 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -3,6 +3,8 @@ # /etc/rc.shutdown # +export RUNLEVEL PRELEVEL + . /etc/rc.conf . /etc/rc.d/functions -- 1.7.2.1
if [[ ${NETWORK_PERSIST,,} = yes && $RUNLEVEL = [06] ]] ; then would look a bit nicer IMHO :)
if [[ ${NETWORK_PERSIST,,} = yes && $RUNLEVEL == [06] ]] ; then would look a bit nicer IMHO :)
Am 2010-08-22 17:40, schrieb Kurt J. Bosch:
if [[ ${NETWORK_PERSIST,,} = yes && $RUNLEVEL == [06] ]] ; then would look a bit nicer IMHO :)
... and RUNLEVEL PREVLEVEL should already be marked for export.
On 22.08.2010 17:49, Kurt J. Bosch wrote:
Am 2010-08-22 17:40, schrieb Kurt J. Bosch:
if [[ ${NETWORK_PERSIST,,} = yes && $RUNLEVEL == [06] ]] ; then would look a bit nicer IMHO :)
... and RUNLEVEL PREVLEVEL should already be marked for export.
Well I haven't tested that, but I can't access them from my X or tty session so I guess they aren't. -- Florian Pritz -- {flo,bluewind}@server-speed.net
Am 2010-08-22 17:52, schrieb Florian Pritz:
On 22.08.2010 17:49, Kurt J. Bosch wrote:
Am 2010-08-22 17:40, schrieb Kurt J. Bosch:
if [[ ${NETWORK_PERSIST,,} = yes&& $RUNLEVEL == [06] ]] ; then would look a bit nicer IMHO :)
... and RUNLEVEL PREVLEVEL should already be marked for export.
Well I haven't tested that, but I can't access them from my X or tty session so I guess they aren't.
That is because you try from within a login shell which sets up its own environment AFAIK. I wrote the scripts for fbsplash and fbsplash-extras which use these variables with stock initscripts.
Signed-off-by: Florian Pritz <bluewind@xssn.at> --- network | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/network b/network index 977e81e..1f3d3db 100755 --- a/network +++ b/network @@ -233,7 +233,7 @@ case "$1" in # exit #fi - if [ "${NETWORK_PERSIST}" = "yes" -o "${NETWORK_PERSIST}" = "YES" ]; then + if [ "${NETWORK_PERSIST}" = "yes" -o "${NETWORK_PERSIST}" = "YES" ] && [[ $RUNLEVEL == [06] ]] ; then status "Skipping Network Shutdown" true exit 0 fi -- 1.7.2.1
2010-08-22 18:50, Florian Pritz:
Signed-off-by: Florian Pritz<bluewind@xssn.at> --- network | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/network b/network index 977e81e..1f3d3db 100755 --- a/network +++ b/network @@ -233,7 +233,7 @@ case "$1" in # exit #fi
- if [ "${NETWORK_PERSIST}" = "yes" -o "${NETWORK_PERSIST}" = "YES" ]; then + if [ "${NETWORK_PERSIST}" = "yes" -o "${NETWORK_PERSIST}" = "YES" ]&& [[ $RUNLEVEL == [06] ]] ; then status "Skipping Network Shutdown" true exit 0 fi
Looks good to me now apart the white space coding style could be fixed: if [ "${NETWORK_PERSIST}" = "yes" -o "${NETWORK_PERSIST}" = "YES" ] && [[ $RUNLEVEL == [06] ]]; then Maybe you should file a bug report? -- Kurt
participants (3)
-
Florian Pritz
-
Florian Pritz
-
Kurt J. Bosch