Use of activate in the script

Non release banter
Kulle
Warlord
Warlord
Posts: 602
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

Use of activate in the script

Post#1 by Kulle » 31 Aug 2020, 14:15

That's working:
echo guest | sudo -S activate example.xzm
But I need:
"If not yet activated, then activate"
How can this be done?

User avatar
Ed_P
Contributor
Contributor
Posts: 8369
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Use of activate in the script

Post#2 by Ed_P » 31 Aug 2020, 14:55

Something like this should work.

Code: Select all

if [ ! -e /mnt/live/memory/images/$CHROME ]; then
   echo $PSWD | sudo -S activate $OPTIONAL/$CHROME     > /dev/null 2>&1 &
   sleep 2
fi
Where PSWD, CHROME and OPTIONAL are set before the if statement.
Ed

otan
Black ninja
Black ninja
Posts: 36
Joined: 23 Jun 2020, 21:31
Distribution: mint

Use of activate in the script

Post#3 by otan » 31 Aug 2020, 15:00

[[ -d /mnt/live/memory/images/example.xzm ]] || activate example.xzm

Post Reply