summarylogtreecommitdiffstats
path: root/netmount.run
diff options
context:
space:
mode:
authorFranc[e]sco2020-10-17 14:23:00 +0200
committerFranc[e]sco2020-10-17 14:23:00 +0200
commit79e5a72078a5348335cd933d2a5c40da70f2cf4f (patch)
treef1aa01091dfbf80443c7ced3a8406c15e1bb5ee0 /netmount.run
parent9af022a2abf50522ef15d6b08e89745c1195fd67 (diff)
downloadaur-79e5a72078a5348335cd933d2a5c40da70f2cf4f.tar.gz
im stupid
Diffstat (limited to 'netmount.run')
-rw-r--r--netmount.run23
1 files changed, 22 insertions, 1 deletions
diff --git a/netmount.run b/netmount.run
index ff53870e84f7..9b0f4d72f9b4 100644
--- a/netmount.run
+++ b/netmount.run
@@ -1 +1,22 @@
-<html><body>You are being <a href="https://raw.githubusercontent.com/void-linux/void-packages/a507a815061ea66190d83392fff1b0516751b48c/srcpkgs/sv-netmount/files/netmount/run">redirected</a>.</body></html> \ No newline at end of file
+#!/bin/sh
+# Load user defined variables
+[ -r conf ] && . ./conf
+
+# Ensure the network manager is running
+[ -z "$NETWORK_MANAGER" ] || sv check "$NETWORK_MANAGER" > /dev/null 2>&1 || exit 1
+
+# If it's running or not in used - rc.local - discover default gateway
+if [ -z "$GATEWAY" ]; then
+ set -- $(ip route show | grep default)
+ GATEWAY="$3"
+fi
+
+ping -W 1 -c 1 $GATEWAY > /dev/null 2>&1 || exit 1
+
+# Network is up and running so now mount network filesystems from fstab
+mount -a -t "$NETWORK_FS" || exit 1
+mount -a -O _netdev || exit 1
+
+# Then wait to behave like the service is up
+exec chpst -b netmount pause
+