Thread: run script at login that requires root privileges
i have script below want run when sister logs account. problem `ifconfig up` or `ifconfig down` requires root privileges. how initiate program when logs in , have root the runner of program.
code:#!/bin/bash while true elevenpm=`date +%s --date "2300"` sevenam=`date +%s --date "0700"` timenow=`date +%s` if [[ ($timenow -gt $sevenam) && ($timenow -lt $elevenpm) ]]; echo "internet up" `ifconfig eth0 up` else echo "internet going down" `ifconfig eth0 down` fi sleep 5m done
you don't need script @ all. cron job fine. read this howto.
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] run script at login that requires root privileges
Ubuntu
Comments
Post a Comment