Browse Source

update wol service

wareck 1 year ago
parent
commit
7f0b51e6dc
1 changed files with 20 additions and 0 deletions
  1. 20 0
      build_cube.sh

+ 20 - 0
build_cube.sh

@@ -182,6 +182,7 @@ sleep 1
 case $Cuda in
 NO)
 	echo -e "$(tput setaf 10)\nInstall NVIDIA GTX1080 Drivers :$(tput sgr0)"
+	sleep 3
 	sudo apt-get install nvidia-driver-525 -y
 	touch /home/wareck/.pass2
 	decompte_
@@ -906,7 +907,25 @@ pids=""
 wait $pids
 }
 
+function wol_ {
+iface=$(ip link | awk -F: '$0 !~ "lo|vir|^[^0-9]"{print $2a;getline}')
+ether=$(which ethtool)
+echo "[Unit]" >>/tmp/wol.service
+echo "Description=Enable Wake On Lan" >>/tmp/wol.service
+echo "" >>/tmp/wol.service
+echo "[Service]" >>/tmp/wol.service
+echo "Type=oneshot" >>/tmp/wol.service
+echo "ExecStart = $ether --change$iface wol g" >>/tmp/wol.service
+echo "" >>/tmp/wol.service
+echo "[Install]" >>/tmp/wol.service
+echo "WantedBy=basic.target" >>/tmp/wol.service
+sudo cp /tmp/wol.service /etc/systemd/system/wol.service
+sudo systemctl daemon-reload
+sudo systemctl enable wol.service
+sudo systemctl start wol.service
+}
 
+wol_
 intro_
 watchdog_
 autoroot_
@@ -924,6 +943,7 @@ mounting_drives_
 cleaning_
 remove_screensaver
 clear
+wol_
 dynmotd
 
 echo -e "$(tput setaf 10)\nEnd of script:$(tput sgr0) \n"