Skip to main content

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

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support