Commit 7c1caa74 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Fix grandenet script

 * correctly test if shill was launched with our wrapper
 * writing accept_ra sys parameter with "all" interface doesn't work
 * no need to remove default routes as writing forwarding sys parameter already does it
 * killall doesn't exist on NayuOS
parent 7fe066e3
......@@ -110,7 +110,7 @@ if [[ $(pgrep re6stnet) ]] ; then
if [ "$stop" == "y" -o "$stop" == "Y" ] ; then
cleanup
echo "Killing re6stnet process..."
killall re6stnet
pkill -x re6stnet -u 0
echo "Exiting."
exit 0
else
......@@ -185,8 +185,8 @@ ip6tables-save -t filter > "${configdir}/ip6tables.save"
cp "${configdir}/ip6tables.save" "${configdir}/current_ip6tables.conf"
# setup shill network manager
if [[ $( pgrep -a shill | grep ${blacklist_option} ) ]] ; then
echo "shill was started with the right blacklist." >> ${logfile}
if lsof -c shill -a /usr/local/opt/re6st/bin/shill_wrapper &> /dev/null ; then
echo "shill was started with our shill wrapper, no need to restart." >> ${logfile}
else
read -p "The network manager shill was not started with the right blacklisted devices list. Restart it [Y/n]? " confirm
if [ "$confirm" != "n" -a "$confirm" != "N" ] ; then
......@@ -230,19 +230,14 @@ else
ip6tables -A INPUT -p tcp --dport 50005 -j ACCEPT
fi
sysctl net.ipv6.conf.all.accept_ra=1 >> "${logfile}" 2>&1
# sysctl net.ipv6.conf.all.accept_ra=1 doesn't work ("all" interface is invalid for accept_ra parameter)
for x in $(grep -l 2 /proc/sys/net/ipv6/conf/*/accept_ra) ; do
echo "echo 1 > $x" >> "${logfile}"
echo 1 > $x
done
# this will remove any autoconfiguration
sysctl net.ipv6.conf.all.forwarding=1 >> "${logfile}" 2>&1
defaultroute=$(ip -6 r | grep default)
if [[ ${defaultroute} != "" ]] ; then
echo $defaultroute | while read line
do
echo -e "Dropping default route: \n\t ${line}"
sudo ip -6 route del default
echo -e "To restore, run: \n\t ip -6 route add $(echo ${line} | sed 's/expires \S\+//')"
done
fi
echo "re6st will start, it may take a few minutes before beeing usable"
echo "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment